diff --git a/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php b/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php index e936dec..00f07a9 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php @@ -186,8 +186,10 @@ public function testSource(array $source_data, array $expected_data, $expected_c } } // False positives occur if the foreach is not entered. So, confirm the - // foreach loop was entered. - $this->assertGreaterThan(0, $i); + // foreach loop was entered if the expected count is greater than 0. + if ($expected_count > 0) { + $this->assertGreaterThan(0, $i); + } } }