diff --git a/src/Testing/AddonTestCase.php b/src/Testing/AddonTestCase.php index ceb982d2676..34460db886b 100644 --- a/src/Testing/AddonTestCase.php +++ b/src/Testing/AddonTestCase.php @@ -31,12 +31,10 @@ protected function setUp(): void $this->preventSavingStacheItemsToDisk(); } - Version::shouldReceive('get')->zeroOrMoreTimes()->andReturn(Composer::create(__DIR__.'/../')->installedVersion(Statamic::PACKAGE)); - $this->addToAssertionCount(-1); + Version::shouldReceive('get')->andReturn(Composer::create(__DIR__.'/../')->installedVersion(Statamic::PACKAGE)); - \Statamic\Facades\CP\Nav::shouldReceive('build')->zeroOrMoreTimes()->andReturn(collect()); - \Statamic\Facades\CP\Nav::shouldReceive('clearCachedUrls')->zeroOrMoreTimes(); - $this->addToAssertionCount(-2); // Dont want to assert this + \Statamic\Facades\CP\Nav::shouldReceive('build')->andReturn(collect()); + \Statamic\Facades\CP\Nav::shouldReceive('clearCachedUrls'); } protected function tearDown(): void diff --git a/tests/FrontendTest.php b/tests/FrontendTest.php index f7447d99078..30af419dd27 100644 --- a/tests/FrontendTest.php +++ b/tests/FrontendTest.php @@ -17,7 +17,6 @@ use Statamic\Facades\Blueprint; use Statamic\Facades\Cascade; use Statamic\Facades\Collection; -use Statamic\Facades\Entry; use Statamic\Facades\User; use Statamic\Tags\Tags; use Statamic\View\Antlers\Language\Utilities\StringUtilities; @@ -38,8 +37,7 @@ public function setUp(): void private function withStandardBlueprints() { - $this->addToAssertionCount(-1); - Blueprint::shouldReceive('in')->withAnyArgs()->zeroOrMoreTimes()->andReturn(collect([new \Statamic\Fields\Blueprint])); + Blueprint::shouldReceive('in')->withAnyArgs()->andReturn(collect([new \Statamic\Fields\Blueprint])); } #[Test] diff --git a/tests/Licensing/AddonLicenseTest.php b/tests/Licensing/AddonLicenseTest.php index e93e5dfce88..687b3584267 100644 --- a/tests/Licensing/AddonLicenseTest.php +++ b/tests/Licensing/AddonLicenseTest.php @@ -14,9 +14,7 @@ class AddonLicenseTest extends TestCase protected function license($response = []) { Addon::shouldReceive('get')->with('test/addon') - ->zeroOrMoreTimes() ->andReturn(new FakeAddonLicenseAddon('Test Addon', '1.2.3', 'rad')); - $this->addToAssertionCount(-1); // dont need to assert this. return new AddonLicense('test/addon', $response); } diff --git a/tests/Licensing/LicenseManagerTest.php b/tests/Licensing/LicenseManagerTest.php index 6138092b38a..44a37e27384 100644 --- a/tests/Licensing/LicenseManagerTest.php +++ b/tests/Licensing/LicenseManagerTest.php @@ -191,8 +191,7 @@ private function managerWithResponse(array $response) { $outpost = $this->mock(Outpost::class); - $this->addToAssertionCount(-1); // Dont want to assert this - $outpost->shouldReceive('response')->zeroOrMoreTimes()->andReturn($response); + $outpost->shouldReceive('response')->andReturn($response); return new LicenseManager($outpost); } diff --git a/tests/Markdown/ManagerTest.php b/tests/Markdown/ManagerTest.php index 2d74a75632d..ab9cd89c738 100644 --- a/tests/Markdown/ManagerTest.php +++ b/tests/Markdown/ManagerTest.php @@ -105,7 +105,6 @@ public function parser_instances_can_be_saved_and_retrieved() #[Test] public function it_throws_an_exception_if_extending_without_returning_a_parser() { - $this->expectNotToPerformAssertions(); $this->expectException(UnexpectedValueException::class); $this->expectExceptionMessage('A ['.Markdown\Parser::class.'] instance is expected.'); diff --git a/tests/TestCase.php b/tests/TestCase.php index 5cc07c2d32b..7836f9017d5 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -37,14 +37,12 @@ protected function setUp(): void } if ($this->shouldFakeVersion) { - \Facades\Statamic\Version::shouldReceive('get')->zeroOrMoreTimes()->andReturn('3.0.0-testing'); - $this->addToAssertionCount(-1); // Dont want to assert this + \Facades\Statamic\Version::shouldReceive('get')->andReturn('3.0.0-testing'); } if ($this->shouldPreventNavBeingBuilt) { - \Statamic\Facades\CP\Nav::shouldReceive('build')->zeroOrMoreTimes()->andReturn(collect()); - \Statamic\Facades\CP\Nav::shouldReceive('clearCachedUrls')->zeroOrMoreTimes(); - $this->addToAssertionCount(-2); // Dont want to assert this + \Statamic\Facades\CP\Nav::shouldReceive('build')->andReturn(collect()); + \Statamic\Facades\CP\Nav::shouldReceive('clearCachedUrls'); } $this->addGqlMacros();