diff --git a/typo3/sysext/core/Tests/Unit/DataHandling/SlugHelperTest.php b/typo3/sysext/core/Tests/Unit/DataHandling/SlugHelperTest.php index 89c95be53387..5cb575d3faa3 100644 --- a/typo3/sysext/core/Tests/Unit/DataHandling/SlugHelperTest.php +++ b/typo3/sysext/core/Tests/Unit/DataHandling/SlugHelperTest.php @@ -20,7 +20,7 @@ use TYPO3\CMS\Core\DataHandling\SlugHelper; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; -class SlugHelperTest extends UnitTestCase +final class SlugHelperTest extends UnitTestCase { protected bool $resetSingletonInstances = true; @@ -487,10 +487,17 @@ public function generatePrependsSlugsForPages(string $input, string $expected, a $options, ] ); - $subject->expects(self::atLeast(2)) + $series = [ + [13, $parentPage], + [10, null], + ]; + $subject->expects(self::exactly(2)) ->method('resolveParentPageRecord') - ->withConsecutive([13], [10]) - ->willReturn($parentPage, null); + ->willReturnCallback(function (int $pid) use (&$series): ?array { + $arguments = array_shift($series); + self::assertSame($arguments[0], $pid); + return $arguments[1]; + }); self::assertEquals( $expected, $subject->generate(['title' => $input, 'uid' => 13], 13)