X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ftaxonomy%2Ftests%2Fsrc%2FKernel%2FMigrate%2Fd6%2FMigrateTaxonomyTermTest.php;h=20ecb6390346241c7f29b610c7b5e4aaf8d8f840;hb=5b8bb166bfa98770daef9de5c127fc2e6ef02340;hp=14fba563b07e06c214cccfd61fe0cba834692502;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;p=yaffs-website diff --git a/web/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTest.php b/web/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTest.php index 14fba563b..20ecb6390 100644 --- a/web/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTest.php +++ b/web/core/modules/taxonomy/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTest.php @@ -92,7 +92,7 @@ class MigrateTaxonomyTermTest extends MigrateDrupal6TestBase { $this->assertSame($values['vid'], $term->vid->target_id); $this->assertSame((string) $values['weight'], $term->weight->value); if ($values['parent'] === [0]) { - $this->assertNull($term->parent->target_id); + $this->assertSame(0, (int) $term->parent->target_id); } else { $parents = []; @@ -104,7 +104,14 @@ class MigrateTaxonomyTermTest extends MigrateDrupal6TestBase { $this->assertArrayHasKey($tid, $tree_terms, "Term $tid exists in vocabulary tree"); $tree_term = $tree_terms[$tid]; - $this->assertEquals($values['parent'], $tree_term->parents, "Term $tid has correct parents in vocabulary tree"); + + // PostgreSQL, MySQL and SQLite may not return the parent terms in the + // same order so sort before testing. + $expected_parents = $values['parent']; + sort($expected_parents); + $actual_parents = $tree_term->parents; + sort($actual_parents); + $this->assertEquals($expected_parents, $actual_parents, "Term $tid has correct parents in vocabulary tree"); } }