-
Notifications
You must be signed in to change notification settings - Fork 0
Initial implementation of Ray.FakeQuery #1
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
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6578304
Add core implementation: FakeQueryModule and related classes
koriym 8404966
Add tests with fixture data and fix DI bindings
koriym c1cf869
Add JSONL support, fake file validation, and code review fixes
koriym 4a483b9
Achieve 100% code coverage
koriym ac4ff56
Add reasons for @codeCoverageIgnore annotations
koriym c741f93
Fix PHPStan excludePaths for optional tests/tmp directory
koriym a2746b2
Address code review feedback
koriym 2d5a879
Add is_readable check and fix minor review issues
koriym 6f2a71f
Remove unused todo_list.json fixture (jsonl is used for collections)
koriym 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,6 @@ parameters: | |
| paths: | ||
| - src | ||
| - tests | ||
| excludePaths: | ||
| analyseAndScan: | ||
| - tests/tmp/* | ||
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 |
|---|---|---|
| @@ -1,20 +1,16 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <phpunit | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" | ||
| bootstrap="vendor/autoload.php" | ||
| > | ||
| <testsuites> | ||
| <testsuite name="Ray.FakeQuery test suite"> | ||
| <directory>tests</directory> | ||
| </testsuite> | ||
| </testsuites> | ||
| <coverage processUncoveredFiles="true"> | ||
| <include> | ||
| <directory suffix=".php">src</directory> | ||
| </include> | ||
| </coverage> | ||
| <php> | ||
| <ini name="error_reporting" value="-1"/> | ||
| </php> | ||
| <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="vendor/autoload.php" cacheDirectory=".phpunit.cache"> | ||
| <testsuites> | ||
| <testsuite name="Ray.FakeQuery test suite"> | ||
| <directory>tests</directory> | ||
| </testsuite> | ||
| </testsuites> | ||
| <php> | ||
| <ini name="error_reporting" value="-1"/> | ||
| </php> | ||
| <source> | ||
| <include> | ||
| <directory suffix=".php">src</directory> | ||
| </include> | ||
| </source> | ||
| </phpunit> |
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,13 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Ray\FakeQuery\Exception; | ||
|
|
||
| final class FakeJsonNotFoundException extends RuntimeException | ||
| { | ||
| public function __construct(string $filename, string $fakeDir) | ||
| { | ||
| parent::__construct("Fake JSON file not found: {$filename} in {$fakeDir}"); | ||
| } | ||
| } |
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,13 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Ray\FakeQuery\Exception; | ||
|
|
||
| final class InvalidFakeDirException extends LogicException | ||
| { | ||
| public function __construct(string $fakeDir) | ||
| { | ||
| parent::__construct("Invalid fake directory: {$fakeDir}"); | ||
| } | ||
| } |
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,13 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Ray\FakeQuery\Exception; | ||
|
|
||
| final class UnknownFakeJsonException extends RuntimeException | ||
| { | ||
| public function __construct(string $filename, string $fakeDir) | ||
| { | ||
| parent::__construct("Unknown fake JSON file: {$filename} in {$fakeDir} has no matching #[DbQuery] id"); | ||
| } | ||
| } |
This file was deleted.
Oops, something went wrong.
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,21 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Ray\FakeQuery; | ||
|
|
||
| use Ray\FakeQuery\Exception\InvalidFakeDirException; | ||
|
|
||
| use function is_dir; | ||
| use function is_readable; | ||
|
|
||
| final class FakeQueryConfig | ||
| { | ||
| public function __construct( | ||
| public readonly string $fakeDir, | ||
| ) { | ||
| if (! is_dir($fakeDir) || ! is_readable($fakeDir)) { | ||
| throw new InvalidFakeDirException($fakeDir); | ||
| } | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| } | ||
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.