Skip to content

Commit

Permalink
[TASK] Avoid withConsecutive() in SlugHelperTest
Browse files Browse the repository at this point in the history
Resolves: #100442
Related: #100249
Releases: main
Change-Id: I5b9c5f90d2a7688f5808513df618219b4eb14bf4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78454
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
  • Loading branch information
lolli42 authored and sbuerk committed Apr 4, 2023
1 parent 2b2951b commit b2aa4c2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions typo3/sysext/core/Tests/Unit/DataHandling/SlugHelperTest.php
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b2aa4c2

Please sign in to comment.