Issue #3402296 by mstrelan, smustgrave: Fix strict type errors in kernel tests: Do not quote integers

(cherry picked from commit 1b1af634d5)
merge-requests/5508/head
Dave Long 2023-11-22 22:32:35 +00:00
parent 6118ef1b4c
commit 1df6d0e108
No known key found for this signature in database
GPG Key ID: ED52AE211E142771
12 changed files with 59 additions and 59 deletions

View File

@ -33,7 +33,7 @@ class MigrateFileTest extends MigrateDrupal7TestBase {
protected function getFileMigrationInfo() {
return [
'path' => 'public://sites/default/files/cube.jpeg',
'size' => '3620',
'size' => 3620,
'base_path' => 'public://',
'plugin_id' => 'd7_file',
];

View File

@ -34,7 +34,7 @@ class MigratePrivateFileTest extends MigrateDrupal7TestBase {
protected function getFileMigrationInfo() {
return [
'path' => 'private://sites/default/private/Babylon5.txt',
'size' => '3',
'size' => 3,
'base_path' => 'private://',
'plugin_id' => 'd7_file_private',
];

View File

@ -31,11 +31,11 @@ class MigrateTaxonomyTermTranslationTest extends TaxonomyTermTranslationTest {
*/
public function testTaxonomyTermTranslation() {
// Forums vocabulary, no multilingual option.
$this->assertEntity(1, 'en', 'General discussion', 'forums', NULL, NULL, '2', []);
$this->assertEntity(5, 'en', 'Custom Forum', 'forums', 'Where the cool kids are.', NULL, '3', []);
$this->assertEntity(6, 'en', 'Games', 'forums', NULL, NULL, '4', []);
$this->assertEntity(7, 'en', 'Minecraft', 'forums', NULL, NULL, '1', ['6']);
$this->assertEntity(8, 'en', 'Half Life 3', 'forums', NULL, NULL, '0', ['6']);
$this->assertEntity(1, 'en', 'General discussion', 'forums', NULL, NULL, 2, []);
$this->assertEntity(5, 'en', 'Custom Forum', 'forums', 'Where the cool kids are.', NULL, 3, []);
$this->assertEntity(6, 'en', 'Games', 'forums', NULL, NULL, 4, []);
$this->assertEntity(7, 'en', 'Minecraft', 'forums', NULL, NULL, 1, ['6']);
$this->assertEntity(8, 'en', 'Half Life 3', 'forums', NULL, NULL, 0, ['6']);
}
}

View File

@ -59,7 +59,7 @@ class FollowUpMigrationsTest extends MigrateDrupal7TestBase {
protected function getFileMigrationInfo() {
return [
'path' => 'public://sites/default/files/cube.jpeg',
'size' => '3620',
'size' => 3620,
'base_path' => 'public://',
'plugin_id' => 'd7_file',
];

View File

@ -88,7 +88,7 @@ class MigrateNodeCompleteTest extends MigrateDrupal7TestBase {
protected function getFileMigrationInfo() {
return [
'path' => 'public://sites/default/files/cube.jpeg',
'size' => '3620',
'size' => 3620,
'base_path' => 'public://',
'plugin_id' => 'd7_file',
];

View File

@ -77,7 +77,7 @@ class MigrateNodeRevisionTest extends MigrateDrupal7TestBase {
protected function getFileMigrationInfo() {
return [
'path' => 'public://sites/default/files/cube.jpeg',
'size' => '3620',
'size' => 3620,
'base_path' => 'public://',
'plugin_id' => 'd7_file',
];

View File

@ -74,7 +74,7 @@ class MigrateNodeTest extends MigrateDrupal7TestBase {
protected function getFileMigrationInfo() {
return [
'path' => 'public://sites/default/files/cube.jpeg',
'size' => '3620',
'size' => 3620,
'base_path' => 'public://',
'plugin_id' => 'd7_file',
];
@ -158,8 +158,8 @@ class MigrateNodeTest extends MigrateDrupal7TestBase {
$this->assertSame(9, $results['node']);
$this->assertSame(0, $results['node_complete']);
$this->assertEntity(1, 'test_content_type', 'en', 'An English Node', '2', TRUE, '1421727515', '1441032132', TRUE, FALSE);
$this->assertRevision(1, 'An English Node', '1', NULL, '1441032132');
$this->assertEntity(1, 'test_content_type', 'en', 'An English Node', 2, TRUE, 1421727515, 1441032132, TRUE, FALSE);
$this->assertRevision(1, 'An English Node', 1, NULL, 1441032132);
$node = Node::load(1);
$this->assertNotEmpty($node->field_boolean->value);

View File

@ -507,7 +507,7 @@ class SecurityAdvisoriesFetcherTest extends KernelTestBase implements LoggerInte
'title' => 'SA title',
'link' => 'http://example.com',
];
$responses[] = new Response('200', [], json_encode([$feed_item]));
$responses[] = new Response(200, [], json_encode([$feed_item]));
}
$this->setTestFeedResponses($responses);
}
@ -634,8 +634,8 @@ class SecurityAdvisoriesFetcherTest extends KernelTestBase implements LoggerInte
'link' => 'http://example.com',
];
$this->setTestFeedResponses([
new Response('500', [], 'HTTPS failed'),
new Response('200', [], json_encode([$feed_item])),
new Response(500, [], 'HTTPS failed'),
new Response(200, [], json_encode([$feed_item])),
]);
$advisories = $this->getAdvisories();
@ -667,7 +667,7 @@ class SecurityAdvisoriesFetcherTest extends KernelTestBase implements LoggerInte
*/
public function testNoHttpFallback(): void {
$this->setTestFeedResponses([
new Response('500', [], 'HTTPS failed'),
new Response(500, [], 'HTTPS failed'),
]);
$exception_thrown = FALSE;

View File

@ -129,23 +129,23 @@ class MigrateTaxonomyTermTest extends MigrateDrupal7TestBase {
$this->assertEntity(24, 'fr', 'FR - Crewman', 'vocabfixed', NULL, NULL, 0, [], NULL, NULL);
// Localized.
$this->assertEntity(19, 'en', 'Jupiter Station', 'vocablocalized', 'Holographic research.', 'filtered_html', '0', []);
$this->assertEntity(20, 'en', 'DS9', 'vocablocalized', 'Terok Nor', 'filtered_html', '0', []);
$this->assertEntity(25, 'en', 'Emissary', 'vocablocalized2', 'Pilot episode', 'filtered_html', '0', []);
$this->assertEntity(19, 'en', 'Jupiter Station', 'vocablocalized', 'Holographic research.', 'filtered_html', 0, []);
$this->assertEntity(20, 'en', 'DS9', 'vocablocalized', 'Terok Nor', 'filtered_html', 0, []);
$this->assertEntity(25, 'en', 'Emissary', 'vocablocalized2', 'Pilot episode', 'filtered_html', 0, []);
/** @var \Drupal\taxonomy\TermInterface $entity */
$entity = Term::load(20);
$this->assertSame('Bajor', $entity->field_sector->value);
// Translate.
$this->assertEntity(21, 'en', 'High council', 'vocabtranslate', NULL, NULL, '0', []);
$this->assertEntity(21, 'en', 'High council', 'vocabtranslate', NULL, NULL, 0, []);
$entity = Term::load(21);
$this->assertSame("K'mpec", $entity->field_chancellor->value);
$this->assertEntity(22, 'fr', 'fr - High council', 'vocabtranslate', NULL, NULL, '0', []);
$this->assertEntity(23, 'is', 'is - High council', 'vocabtranslate', NULL, NULL, '0', []);
$this->assertEntity(22, 'fr', 'fr - High council', 'vocabtranslate', NULL, NULL, 0, []);
$this->assertEntity(23, 'is', 'is - High council', 'vocabtranslate', NULL, NULL, 0, []);
// Fixed.
$this->assertEntity(24, 'fr', 'FR - Crewman', 'vocabfixed', NULL, NULL, '0', []);
$this->assertEntity(24, 'fr', 'FR - Crewman', 'vocabfixed', NULL, NULL, 0, []);
// Tests the migration of taxonomy term entity translations.
$manager = $this->container->get('content_translation.manager');

View File

@ -132,48 +132,48 @@ class MigrateTaxonomyTermTranslationTest extends MigrateDrupal7TestBase {
*/
public function testTaxonomyTermTranslation() {
// Forums vocabulary, no multilingual option.
$this->assertEntity(1, 'en', 'General discussion', 'sujet_de_discussion', NULL, NULL, '2', []);
$this->assertEntity(5, 'en', 'Custom Forum', 'sujet_de_discussion', 'Where the cool kids are.', NULL, '3', []);
$this->assertEntity(6, 'en', 'Games', 'sujet_de_discussion', NULL, NULL, '4', []);
$this->assertEntity(7, 'en', 'Minecraft', 'sujet_de_discussion', NULL, NULL, '1', ['6']);
$this->assertEntity(8, 'en', 'Half Life 3', 'sujet_de_discussion', NULL, NULL, '0', ['6']);
$this->assertEntity(1, 'en', 'General discussion', 'sujet_de_discussion', NULL, NULL, 2, []);
$this->assertEntity(5, 'en', 'Custom Forum', 'sujet_de_discussion', 'Where the cool kids are.', NULL, 3, []);
$this->assertEntity(6, 'en', 'Games', 'sujet_de_discussion', NULL, NULL, 4, []);
$this->assertEntity(7, 'en', 'Minecraft', 'sujet_de_discussion', NULL, NULL, 1, ['6']);
$this->assertEntity(8, 'en', 'Half Life 3', 'sujet_de_discussion', NULL, NULL, 0, ['6']);
// Test vocabulary, field translation.
$this->assertEntity(2, 'en', 'Term1 (This is a real field!)', 'test_vocabulary', 'The first term. (This is a real field!)', 'filtered_html', '0', []);
$this->assertEntity(3, 'en', 'Term2', 'test_vocabulary', 'The second term.', 'filtered_html', '0', []);
$this->assertEntity(4, 'en', 'Term3 in plain old English', 'test_vocabulary', 'The third term in plain old English.', 'full_html', '0', ['3']);
$this->assertEntity(2, 'en', 'Term1 (This is a real field!)', 'test_vocabulary', 'The first term. (This is a real field!)', 'filtered_html', 0, []);
$this->assertEntity(3, 'en', 'Term2', 'test_vocabulary', 'The second term.', 'filtered_html', 0, []);
$this->assertEntity(4, 'en', 'Term3 in plain old English', 'test_vocabulary', 'The third term in plain old English.', 'full_html', 0, ['3']);
// Tags vocabulary, no multilingual option.
$this->assertEntity(9, 'en', 'Benjamin Sisko', 'tags', 'Portrayed by Avery Brooks', 'filtered_html', '0', []);
$this->assertEntity(10, 'en', 'Kira Nerys', 'tags', 'Portrayed by Nana Visitor', 'filtered_html', '0', []);
$this->assertEntity(11, 'en', 'Dax', 'tags', 'Portrayed by Terry Farrell', 'filtered_html', '0', []);
$this->assertEntity(12, 'en', 'Jake Sisko', 'tags', 'Portrayed by Cirroc Lofton', 'filtered_html', '0', []);
$this->assertEntity(13, 'en', 'Gul Dukat', 'tags', 'Portrayed by Marc Alaimo', 'filtered_html', '0', []);
$this->assertEntity(14, 'en', 'Odo', 'tags', 'Portrayed by Rene Auberjonois', 'filtered_html', '0', []);
$this->assertEntity(15, 'en', 'Worf', 'tags', 'Portrayed by Michael Dorn', 'filtered_html', '0', []);
$this->assertEntity(16, 'en', "Miles O'Brien", 'tags', 'Portrayed by Colm Meaney', 'filtered_html', '0', []);
$this->assertEntity(17, 'en', 'Quark', 'tags', 'Portrayed by Armin Shimerman', 'filtered_html', '0', []);
$this->assertEntity(18, 'en', 'Elim Garak', 'tags', 'Portrayed by Andrew Robinson', 'filtered_html', '0', []);
$this->assertEntity(9, 'en', 'Benjamin Sisko', 'tags', 'Portrayed by Avery Brooks', 'filtered_html', 0, []);
$this->assertEntity(10, 'en', 'Kira Nerys', 'tags', 'Portrayed by Nana Visitor', 'filtered_html', 0, []);
$this->assertEntity(11, 'en', 'Dax', 'tags', 'Portrayed by Terry Farrell', 'filtered_html', 0, []);
$this->assertEntity(12, 'en', 'Jake Sisko', 'tags', 'Portrayed by Cirroc Lofton', 'filtered_html', 0, []);
$this->assertEntity(13, 'en', 'Gul Dukat', 'tags', 'Portrayed by Marc Alaimo', 'filtered_html', 0, []);
$this->assertEntity(14, 'en', 'Odo', 'tags', 'Portrayed by Rene Auberjonois', 'filtered_html', 0, []);
$this->assertEntity(15, 'en', 'Worf', 'tags', 'Portrayed by Michael Dorn', 'filtered_html', 0, []);
$this->assertEntity(16, 'en', "Miles O'Brien", 'tags', 'Portrayed by Colm Meaney', 'filtered_html', 0, []);
$this->assertEntity(17, 'en', 'Quark', 'tags', 'Portrayed by Armin Shimerman', 'filtered_html', 0, []);
$this->assertEntity(18, 'en', 'Elim Garak', 'tags', 'Portrayed by Andrew Robinson', 'filtered_html', 0, []);
// Localized.
$this->assertEntity(19, 'en', 'Jupiter Station', 'vocablocalized', 'Holographic research.', 'filtered_html', '0', []);
$this->assertEntity(20, 'en', 'DS9', 'vocablocalized', 'Terok Nor', 'filtered_html', '0', []);
$this->assertEntity(19, 'en', 'Jupiter Station', 'vocablocalized', 'Holographic research.', 'filtered_html', 0, []);
$this->assertEntity(20, 'en', 'DS9', 'vocablocalized', 'Terok Nor', 'filtered_html', 0, []);
/** @var \Drupal\taxonomy\TermInterface $entity */
$entity = Term::load(20);
$this->assertSame('Bajor', $entity->field_sector->value);
// Translate.
$this->assertEntity(21, 'en', 'High council', 'vocabtranslate', NULL, NULL, '0', []);
$this->assertEntity(21, 'en', 'High council', 'vocabtranslate', NULL, NULL, 0, []);
$entity = Term::load(21);
$this->assertSame("K'mpec", $entity->field_chancellor->value);
$this->assertEntity(22, 'fr', 'fr - High council', 'vocabtranslate', NULL, NULL, '0', []);
$this->assertEntity(22, 'fr', 'fr - High council', 'vocabtranslate', NULL, NULL, 0, []);
$entity = Term::load(22);
$this->assertSame("fr - K'mpec", $entity->field_chancellor->value);
$this->assertEntity(23, 'is', 'is - High council', 'vocabtranslate', NULL, NULL, '0', []);
$this->assertEntity(23, 'is', 'is - High council', 'vocabtranslate', NULL, NULL, 0, []);
// Fixed.
$this->assertEntity(24, 'fr', 'FR - Crewman', 'vocabfixed', NULL, NULL, '0', []);
$this->assertEntity(24, 'fr', 'FR - Crewman', 'vocabfixed', NULL, NULL, 0, []);
$entity = Term::load(24);
$this->assertSame('fr - specialist', $entity->field_training->value);
}

View File

@ -110,7 +110,7 @@ class MigrateUserRoleTest extends MigrateDrupal6TestBase {
],
'role_data' => [
'anonymous' => [
'rid' => '1',
'rid' => 1,
'valid' => [
'access content',
'use text format filtered_html',
@ -120,7 +120,7 @@ class MigrateUserRoleTest extends MigrateDrupal6TestBase {
],
],
'authenticated' => [
'rid' => '2',
'rid' => 2,
'valid' => [
'access content',
'use text format filtered_html',
@ -133,7 +133,7 @@ class MigrateUserRoleTest extends MigrateDrupal6TestBase {
],
],
'migrate_test_role_1' => [
'rid' => '3',
'rid' => 3,
'valid' => [
'use text format full_html',
'use text format php_code',
@ -143,7 +143,7 @@ class MigrateUserRoleTest extends MigrateDrupal6TestBase {
],
],
'migrate_test_role_2' => [
'rid' => '4',
'rid' => 4,
'valid' => [
'access content overview',
'administer nodes',
@ -166,7 +166,7 @@ class MigrateUserRoleTest extends MigrateDrupal6TestBase {
],
],
'migrate_test_role_3_that_is_longer_than_thirty_two_characters' => [
'rid' => '5',
'rid' => 5,
'valid' => [
'use text format php_code',
],
@ -200,7 +200,7 @@ class MigrateUserRoleTest extends MigrateDrupal6TestBase {
],
'role_data' => [
'anonymous' => [
'rid' => '1',
'rid' => 1,
'valid' => [
'access content',
'use text format filtered_html',
@ -210,7 +210,7 @@ class MigrateUserRoleTest extends MigrateDrupal6TestBase {
],
],
'authenticated' => [
'rid' => '2',
'rid' => 2,
'valid' => [
'access comments',
'access content',
@ -223,7 +223,7 @@ class MigrateUserRoleTest extends MigrateDrupal6TestBase {
],
],
'migrate_test_role_1' => [
'rid' => '3',
'rid' => 3,
'valid' => [
'use text format full_html',
'use text format php_code',
@ -233,7 +233,7 @@ class MigrateUserRoleTest extends MigrateDrupal6TestBase {
],
],
'migrate_test_role_2' => [
'rid' => '4',
'rid' => 4,
'valid' => [
'access content overview',
'administer contact forms',
@ -256,7 +256,7 @@ class MigrateUserRoleTest extends MigrateDrupal6TestBase {
],
],
'migrate_test_role_3_that_is_longer_than_thirty_two_characters' => [
'rid' => '5',
'rid' => 5,
'valid' => [
'use text format php_code',
],

View File

@ -62,7 +62,7 @@ class SelectComplexTest extends DatabaseTestBase {
$result = $query->execute();
$num_records = 0;
$last_name = 0;
$last_name = '0';
// Verify that the results are returned in the correct order.
foreach ($result as $record) {