test: migrate doctrine behat features to ApiTestCase#8205
Open
soyuka wants to merge 2 commits into
Open
Conversation
Drop six behat scenarios in favor of PHPUnit ApiTestCase: - handle_links.feature -> tests/Functional/Doctrine/LinkHandlerTest.php - issue5722/subresource_without_get.feature -> tests/Functional/SubResource/SubResourceWithoutGetTest.php - issue6175/standard_put_entity_inheritence -> tests/Functional/Doctrine/MappedSuperclassPutTest.php - eager_loading.feature -> tests/Functional/Doctrine/EagerLoadingTest.php - separated_resource.feature -> tests/Functional/Doctrine/SeparatedResourceTest.php - multiple_filter.feature -> tests/Functional/Doctrine/MultipleFilterTest.php EagerLoadingTest reads ApiPlatform\Tests\Fixtures\TestBundle\Doctrine\Orm\EntityManager::\$dql to assert the produced DQL, mirroring behat's "the DQL should be equal to" step.
a3dee79 to
66541c0
Compare
Drop seven behat filter scenarios in favor of PHPUnit ApiTestCase: - boolean_filter.feature -> tests/Functional/Doctrine/BooleanFilterTest.php - exists_filter.feature -> tests/Functional/Doctrine/ExistsFilterTest.php - numeric_filter.feature -> tests/Functional/Doctrine/NumericFilterTest.php - range_filter.feature -> tests/Functional/Doctrine/RangeFilterTest.php - date_filter.feature -> tests/Functional/Doctrine/DateFilterTest.php - order_filter.feature -> tests/Functional/Doctrine/OrderFilterTest.php - search_filter.feature -> tests/Functional/Doctrine/SearchFilterTest.php Scenario outlines map to PHPUnit's #[TestWith] attribute. Postgres-only scenarios are env-gated via \$this->isSqlite()/isPostgres() checks.
66541c0 to
20a937d
Compare
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.
Summary
Removes all remaining
features/doctrine/*.featurebehat scenarios and replaces them with PHPUnitApiTestCasetests, mirroring the migration pattern from prior phases.Phase 1 — trivial features (commit
c69e2a4b9)handle_links.featuretests/Functional/Doctrine/LinkHandlerTest.phpissue5722/subresource_without_get.featuretests/Functional/SubResource/SubResourceWithoutGetTest.phpissue6175/standard_put_entity_inheritence.featuretests/Functional/Doctrine/MappedSuperclassPutTest.phpeager_loading.featuretests/Functional/Doctrine/EagerLoadingTest.phpseparated_resource.featuretests/Functional/Doctrine/SeparatedResourceTest.phpmultiple_filter.featuretests/Functional/Doctrine/MultipleFilterTest.phpEagerLoadingTestreadsApiPlatform\Tests\Fixtures\TestBundle\Doctrine\Orm\EntityManager::$dqlto assert the produced DQL, mirroring behat's the DQL should be equal to step.Phase 2 — filter features (commit
a3dee79f7)boolean_filter.featuretests/Functional/Doctrine/BooleanFilterTest.phpexists_filter.featuretests/Functional/Doctrine/ExistsFilterTest.phpnumeric_filter.featuretests/Functional/Doctrine/NumericFilterTest.phprange_filter.featuretests/Functional/Doctrine/RangeFilterTest.phpdate_filter.featuretests/Functional/Doctrine/DateFilterTest.phporder_filter.featuretests/Functional/Doctrine/OrderFilterTest.phpsearch_filter.featuretests/Functional/Doctrine/SearchFilterTest.phpScenario outlines map to PHPUnit's
#[TestWith]attribute. Postgres- and SQLite-specific scenarios are gated via$this->isSqlite()/$this->isPostgres()checks.Stats
vendor/bin/phpunit tests/Functional/Doctrine/— 114 tests, 376 assertions, 5 skipped (mongo-only scenarios), 0 failures.GraphQL features (
features/graphql/*.feature) are deliberately left out of this PR.Test plan
USE_SYMFONY_LISTENERS=1