Repository navigation
Move the tests into tests/Unit and add missing unit tests - #12
Merged
Merged
Conversation
The tests now live in the Setono\ClientBundle\Tests\Unit namespace and run as the Unit test suite, which makes room for a Functional suite next to it.
- Configuration: defaults, overrides and partial cookie configuration - Extension: custom values become parameters, and the subscribers, value resolver and Doctrine listener are tagged - StoreCookieSubscriber: the last seen timestamp is refreshed, and the configured cookie name and expiration are used - CachedCookieProvider: a missing cookie is cached, and each request is resolved separately - DoctrineOrmBasedMetadataProvider: no query before the metadata is used, the fallback to the decorated provider, and loaded metadata is not dirty - DoctrineOrmBasedMetadataPersister: lazy metadata that was only read is not written, and lazy metadata that was changed is
This was referenced Oct 26, 2026
loevgaard
commented
Oct 26, 2026
loevgaard
commented
Oct 26, 2026
loevgaard
commented
Oct 26, 2026
loevgaard
commented
Oct 26, 2026
loevgaard
commented
Oct 26, 2026
loevgaard
commented
Oct 26, 2026
loevgaard
commented
Oct 26, 2026
loevgaard
commented
Oct 26, 2026
loevgaard
commented
Oct 26, 2026
loevgaard
commented
Oct 26, 2026
loevgaard
commented
Oct 26, 2026
loevgaard
commented
Oct 26, 2026
loevgaard
commented
Oct 26, 2026
loevgaard
commented
Oct 26, 2026
loevgaard
commented
Oct 26, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The tests move to
tests/Unit, so the functional tests in #13 can go intotests/Functionalnext to them. This PR also adds unit tests for behaviour that no test asserted yet.Changes
tests/totests/Unit/, in theSetono\ClientBundle\Tests\Unitnamespace, and run as theunittest suite. Apart from the namespace, the only change to a moved test is the package root path inSetonoClientBundleTest.Configuration(newConfigurationTest): defaults, overrides, and a partial cookie configuration that keeps the other default. It usesmatthiasnoback/symfony-config-test, which was already installed throughsymfony-dependency-injection-testand is now declared.SetonoClientExtension: custom values end up in the container parameters. The two subscribers, the value resolver and the Doctrine listener carry their tags; without those tags the bundle silently does nothing.StoreCookieSubscriber: an existing cookie gets a new last seen timestamp and keeps its first seen timestamp. The configured cookie name and expiration are used.CachedCookieProvider: a missing cookie is cached too, and each request is resolved separately.DoctrineOrmBasedMetadataProvider: nothing is queried before the metadata is used, the decorated provider's metadata is used when the client has no row, and loaded metadata isn't dirty.DoctrineOrmBasedMetadataPersister: lazy metadata that was only read isn't written, and lazy metadata that was changed is.Testing
composer validate --strictandcomposer normalize --dry-runpassStack
Five PRs that add tests to the bundle and fix what the tests and their review found. Review and merge them in this order. #14, #15 and #20 are independent of each other and all build on #13.
tests/Unitand add the unit tests that were missingmetadata_classthat extends the bundle'sMetadata, found by the functional tests