Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/Testing/AddonTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions tests/FrontendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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]
Expand Down
2 changes: 0 additions & 2 deletions tests/Licensing/AddonLicenseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 1 addition & 2 deletions tests/Licensing/LicenseManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
1 change: 0 additions & 1 deletion tests/Markdown/ManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.');

Expand Down
8 changes: 3 additions & 5 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down