Repository navigation
Move the tests into tests/Unit and add missing unit tests #12
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 all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
16a1d7f
Move the existing tests into tests/Unit
loevgaard 73e41d7
Add missing unit tests
loevgaard 6920f7b
Use lowercase test suite names
loevgaard 7ce7fa3
Tell the requests apart by identity in the cookie cache test
loevgaard 85b899b
Test the persister with a lazy ghost instead of the real provider
loevgaard 492bde1
Share the setup in the provider and subscriber tests
loevgaard 741a25d
Mention symfony-config-test in CLAUDE.md
loevgaard 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Setono\ClientBundle\Tests\Unit\DependencyInjection; | ||
|
|
||
| use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; | ||
| use PHPUnit\Framework\TestCase; | ||
| use Setono\ClientBundle\DependencyInjection\Configuration; | ||
| use Setono\ClientBundle\Entity\Metadata; | ||
| use Setono\ClientBundle\Tests\Unit\DependencyInjection\Fixture\CustomMetadata; | ||
|
|
||
| final class ConfigurationTest extends TestCase | ||
| { | ||
| use ConfigurationTestCaseTrait; | ||
|
|
||
| protected function getConfiguration(): Configuration | ||
| { | ||
| return new Configuration(); | ||
| } | ||
|
|
||
| /** | ||
| * @test | ||
| */ | ||
| public function it_has_default_values(): void | ||
| { | ||
| $this->assertProcessedConfigurationEquals([], [ | ||
| 'cookie' => [ | ||
| 'name' => 'setono_client_id', | ||
| 'expiration' => '+365 days', | ||
| ], | ||
| 'metadata_class' => Metadata::class, | ||
| ]); | ||
| } | ||
|
|
||
| /** | ||
| * @test | ||
| */ | ||
| public function it_allows_overriding_the_values(): void | ||
| { | ||
| $this->assertProcessedConfigurationEquals([ | ||
| [ | ||
|
loevgaard marked this conversation as resolved.
|
||
| 'cookie' => [ | ||
| 'name' => 'client_id', | ||
| 'expiration' => '+30 days', | ||
| ], | ||
| 'metadata_class' => CustomMetadata::class, | ||
| ], | ||
| ], [ | ||
| 'cookie' => [ | ||
| 'name' => 'client_id', | ||
| 'expiration' => '+30 days', | ||
| ], | ||
| 'metadata_class' => CustomMetadata::class, | ||
| ]); | ||
| } | ||
|
|
||
| /** | ||
| * @test | ||
| */ | ||
| public function it_keeps_the_default_of_a_cookie_option_that_is_not_overridden(): void | ||
| { | ||
| $this->assertProcessedConfigurationEquals([ | ||
| ['cookie' => ['name' => 'client_id']], | ||
| ], [ | ||
| 'cookie' => [ | ||
| 'name' => 'client_id', | ||
| 'expiration' => '+365 days', | ||
| ], | ||
| 'metadata_class' => Metadata::class, | ||
| ]); | ||
| } | ||
| } | ||
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,11 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace Setono\ClientBundle\Tests\Unit\DependencyInjection\Fixture; | ||
|
|
||
| use Setono\ClientBundle\Entity\Metadata; | ||
|
|
||
| final class CustomMetadata extends Metadata | ||
| { | ||
| } |
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
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.