Repository navigation
Issue/481 enum exception coverage #484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
armanist
merged 29 commits into
quantum-php:master
from
armanist:issue/481-enum-exception-coverage
Apr 29, 2026
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
7e8a788
[#481] Normalize enum and trivial exception coverage annotations
armanist 4f096e7
[#481] Add App exception factory coverage tests
armanist eb38106
[#481] Add Archive exception factory coverage tests
armanist abbb942
[#481] Add Asset exception factory coverage tests
armanist 732bd5f
[#481] Add Auth exception factory coverage tests
armanist 16c4549
[#481] Add Config exception factory coverage tests
armanist 8bff370
[#481] Align exception tests with source folder structure
armanist 763a687
[#481] Add Csrf exception factory coverage tests
armanist 8b83dfe
[#481] Add Database exception factory coverage tests
armanist 00f2b30
[#481] Add Di exception factory coverage tests
armanist e30bb61
[#481] Add Encryption exception factory coverage tests
armanist 23ac19c
[#481] Add Environment exception factory coverage tests
armanist fe637cf
[#481] Add Hasher exception factory coverage tests
armanist 74583d9
[#481] Add Hook exception factory coverage tests
armanist 2399500
[#481] Add HttpClient exception factory coverage tests
armanist d665761
[#481] Add Jwt exception factory coverage tests
armanist 61206d1
[#481] Add Lang exception factory coverage tests
armanist dd89383
[#481] Add Logger exception factory coverage tests
armanist 0ac782a
[#481] Add Middleware exception factory coverage tests
armanist c655a83
[#481] Add Migration exception factory coverage tests
armanist 87d63ba
[#481] Add Model exception factory coverage tests
armanist 32c5941
[#481] Add Module exception factory coverage tests
armanist aa4145e
[#481] Add Paginator exception factory coverage tests
armanist 85b53c2
[#481] Add Router exception factory coverage tests
armanist a27e733
[#481] Add Session exception factory coverage tests
armanist 5b1b056
[#481] Add Storage exception factory coverage tests
armanist 8bd7838
[#481] Add View exception factory coverage tests
armanist f0243f7
[#481] CS fixes
armanist 6efc846
Fix CaptchaException docblock and RouteException code assertions
armanist File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,18 @@ | ||
| <?php | ||
|
|
||
| namespace Quantum\Tests\Unit\App\Exceptions; | ||
|
|
||
| use Quantum\App\Exceptions\AppException; | ||
| use Quantum\Tests\Unit\AppTestCase; | ||
|
|
||
| class AppExceptionTest extends AppTestCase | ||
| { | ||
| public function testMissingAppKeyFactory(): void | ||
| { | ||
| $exception = AppException::missingAppKey(); | ||
|
|
||
| $this->assertInstanceOf(AppException::class, $exception); | ||
| $this->assertSame('APP KEY is missing.', $exception->getMessage()); | ||
| $this->assertSame(E_ERROR, $exception->getCode()); | ||
| } | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
This file contains hidden or 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,61 @@ | ||
| <?php | ||
|
|
||
| namespace Quantum\Tests\Unit\App\Exceptions; | ||
|
|
||
| use Quantum\App\Exceptions\BaseException; | ||
| use Quantum\Tests\Unit\AppTestCase; | ||
|
|
||
| class BaseExceptionStub extends BaseException | ||
| { | ||
| } | ||
|
|
||
| class BaseExceptionTest extends AppTestCase | ||
| { | ||
| public function testMethodNotSupportedFactory(): void | ||
| { | ||
| $exception = BaseExceptionStub::methodNotSupported('foo', 'Bar'); | ||
|
|
||
| $this->assertInstanceOf(BaseExceptionStub::class, $exception); | ||
| $this->assertSame('The method `foo` is not supported for `Bar`.', $exception->getMessage()); | ||
| $this->assertSame(E_WARNING, $exception->getCode()); | ||
| } | ||
|
|
||
| public function testAdapterAndDriverFactories(): void | ||
| { | ||
| $adapterException = BaseExceptionStub::adapterNotSupported('x'); | ||
| $driverException = BaseExceptionStub::driverNotSupported('y'); | ||
|
|
||
| $this->assertSame('The adapter `x` is not supported.', $adapterException->getMessage()); | ||
| $this->assertSame(E_ERROR, $adapterException->getCode()); | ||
| $this->assertSame('The driver `y` is not supported.', $driverException->getMessage()); | ||
| $this->assertSame(E_ERROR, $driverException->getCode()); | ||
| } | ||
|
|
||
| public function testLookupAndConnectionFactories(): void | ||
| { | ||
| $fileException = BaseExceptionStub::fileNotFound('a.php'); | ||
| $notFoundException = BaseExceptionStub::notFound('Route', 'home'); | ||
| $instanceException = BaseExceptionStub::notInstanceOf('Foo', 'Bar'); | ||
| $connectException = BaseExceptionStub::cantConnect('redis'); | ||
|
|
||
| $this->assertSame('The file `a.php` not found.', $fileException->getMessage()); | ||
| $this->assertSame(E_ERROR, $fileException->getCode()); | ||
| $this->assertSame('Route `home` not found.', $notFoundException->getMessage()); | ||
| $this->assertSame(E_ERROR, $notFoundException->getCode()); | ||
| $this->assertSame('The `Foo` is not instance of `Bar`.', $instanceException->getMessage()); | ||
| $this->assertSame(E_ERROR, $instanceException->getCode()); | ||
| $this->assertSame('Can not connect to `redis`.', $connectException->getMessage()); | ||
| $this->assertSame(E_ERROR, $connectException->getCode()); | ||
| } | ||
|
|
||
| public function testConfigAndRequestMethodFactories(): void | ||
| { | ||
| $configException = BaseExceptionStub::missingConfig('database'); | ||
| $methodException = BaseExceptionStub::requestMethodNotAvailable('PATCH'); | ||
|
|
||
| $this->assertSame('Could not load config `database` properly.', $configException->getMessage()); | ||
| $this->assertSame(E_ERROR, $configException->getCode()); | ||
| $this->assertSame('Provided request method `PATCH` is not available.', $methodException->getMessage()); | ||
| $this->assertSame(E_WARNING, $methodException->getCode()); | ||
| } | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
This file contains hidden or 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,27 @@ | ||
| <?php | ||
|
|
||
| namespace Quantum\Tests\Unit\Archive\Exceptions; | ||
|
|
||
| use Quantum\Archive\Exceptions\ArchiveException; | ||
| use Quantum\Tests\Unit\AppTestCase; | ||
|
|
||
| class ArchiveExceptionTest extends AppTestCase | ||
| { | ||
| public function testCantOpen(): void | ||
| { | ||
| $exception = ArchiveException::cantOpen('demo.zip'); | ||
|
|
||
| $this->assertInstanceOf(ArchiveException::class, $exception); | ||
| $this->assertSame('The archive `demo.zip` can not be opened', $exception->getMessage()); | ||
| $this->assertSame(E_WARNING, $exception->getCode()); | ||
| } | ||
|
|
||
| public function testMissingArchiveName(): void | ||
| { | ||
| $exception = ArchiveException::missingArchiveName(); | ||
|
|
||
| $this->assertInstanceOf(ArchiveException::class, $exception); | ||
| $this->assertSame('Archive name is not set', $exception->getMessage()); | ||
| $this->assertSame(E_WARNING, $exception->getCode()); | ||
| } | ||
| } |
This file contains hidden or 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,27 @@ | ||
| <?php | ||
|
|
||
| namespace Quantum\Tests\Unit\Asset\Exceptions; | ||
|
|
||
| use Quantum\Asset\Exceptions\AssetException; | ||
| use Quantum\Tests\Unit\AppTestCase; | ||
|
|
||
| class AssetExceptionTest extends AppTestCase | ||
| { | ||
| public function testPositionInUse(): void | ||
| { | ||
| $exception = AssetException::positionInUse(7, 'styles.css'); | ||
|
|
||
| $this->assertInstanceOf(AssetException::class, $exception); | ||
| $this->assertSame('Position `7` for asset `styles.css` is in use', $exception->getMessage()); | ||
| $this->assertSame(E_WARNING, $exception->getCode()); | ||
| } | ||
|
|
||
| public function testNameInUse(): void | ||
| { | ||
| $exception = AssetException::nameInUse('main-style'); | ||
|
|
||
| $this->assertInstanceOf(AssetException::class, $exception); | ||
| $this->assertSame('The name main-style is in use', $exception->getMessage()); | ||
| $this->assertSame(E_WARNING, $exception->getCode()); | ||
| } | ||
| } | ||
|
armanist marked this conversation as resolved.
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.