-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #279 from scoutapp/8.2.x-merge-up-into-8.3.x_HRmWB1eN
Merge release 8.2.2 into 8.3.x
- Loading branch information
Showing
3 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Scoutapm\Extension; | ||
|
||
final class DoNotInvokeAnyExtensionCapabilities implements ExtensionCapabilities | ||
{ | ||
/** @return array<empty, empty> */ | ||
public function getCalls(): array | ||
{ | ||
// Intentionally, there are no calls | ||
return []; | ||
} | ||
|
||
public function clearRecordedCalls(): void | ||
{ | ||
// Intentially no-op, don't invoke the extension | ||
} | ||
|
||
public function version(): ?Version | ||
{ | ||
// Extension is ignored/doesn't exist, so no version to return | ||
return null; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
tests/Unit/Extension/DoNotInvokeAnyExtensionCapabilitiesTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Scoutapm\UnitTests\Extension; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Scoutapm\Extension\DoNotInvokeAnyExtensionCapabilities; | ||
|
||
use function file_get_contents; | ||
|
||
/** @covers \Scoutapm\Extension\DoNotInvokeAnyExtensionCapabilities */ | ||
final class DoNotInvokeAnyExtensionCapabilitiesTest extends TestCase | ||
{ | ||
public function testClearRecordedCalls(): void | ||
{ | ||
$capabilities = new DoNotInvokeAnyExtensionCapabilities(); | ||
self::assertEquals([], $capabilities->getCalls()); | ||
$capabilities->clearRecordedCalls(); | ||
self::assertEquals([], $capabilities->getCalls()); | ||
} | ||
|
||
public function testGetCalls(): void | ||
{ | ||
file_get_contents(__FILE__); | ||
self::assertEquals([], (new DoNotInvokeAnyExtensionCapabilities())->getCalls()); | ||
} | ||
|
||
public function testVersion(): void | ||
{ | ||
self::assertNull((new DoNotInvokeAnyExtensionCapabilities())->version()); | ||
} | ||
} |