diff --git a/tests/Schema/ComparatorTest.php b/tests/Schema/ComparatorTest.php index 379ba39a49c..f394d9c43a4 100644 --- a/tests/Schema/ComparatorTest.php +++ b/tests/Schema/ComparatorTest.php @@ -633,16 +633,30 @@ public function testComparesNamespaces(): void ->method('getNamespaces') ->willReturn(['foo', 'bar']); + $matcher = self::exactly(2); + $oldSchema->method('hasNamespace') - ->withConsecutive(['bar'], ['baz']) + ->willReturnCallback(static function (string $name) use ($matcher): void { + match ($matcher->numberOfInvocations()) { + 1 => self::assertEquals('bar', $name), + 2 => self::assertEquals('baz', $name), + }; + }) ->willReturnOnConsecutiveCalls(true, false); $newSchema->expects(self::once()) ->method('getNamespaces') ->willReturn(['bar', 'baz']); + $matcher = self::exactly(2); + $newSchema->method('hasNamespace') - ->withConsecutive(['foo'], ['bar']) + ->willReturnCallback(static function (string $name) use ($matcher): void { + match ($matcher->numberOfInvocations()) { + 1 => self::assertEquals('foo', $name), + 2 => self::assertEquals('bar', $name), + }; + }) ->willReturnOnConsecutiveCalls(false, true); $diff = $this->comparator->compareSchemas($oldSchema, $newSchema);