diff -u b/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php b/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php --- b/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateSourceTestBase.php @@ -133,10 +133,10 @@ * (optional) How many rows the source plugin is expected to return. * Defaults to count($expected_data). If set to a non-null, non-numeric * value (like FALSE or 'nope'), the source plugin will not be counted. - * @param mixed $high_water - * (optional) The value of the high water field. * @param array $configuration * (optional) Configuration for the source plugin. + * @param mixed $high_water + * (optional) The value of the high water field. * * @dataProvider providerSource */ @@ -158,8 +158,8 @@ $expected_count = count($expected_data); } // If an expected count was given, assert it only if the plugin is - // countable. - if (is_numeric($expected_count)) { + // countable and there is no high water mark. + if (is_numeric($expected_count) && !isset($high_water)) { $this->assertInstanceOf('\Countable', $plugin); $this->assertCount($expected_count, $plugin); } @@ -185,6 +185,10 @@ } } } + + if (isset($high_water)) { + $this->assertSame($expected_count, $i); + } } }