Skip to content

Commit d44867d

Browse files
authored
test: migrate elasticsearch/security/serializer/mongodb behat suites to ApiTestCase (#8202)
1 parent e6922f1 commit d44867d

37 files changed

Lines changed: 2886 additions & 1806 deletions

.github/workflows/ci.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,6 @@ jobs:
456456
php: ${{ fromJSON(github.event_name == 'pull_request' && '["8.2","8.5"]' || '["8.2","8.3","8.4","8.5"]') }}
457457
shard:
458458
- graphql-doctrine
459-
- misc
460459
include:
461460
- php: '8.5'
462461
shard: graphql-doctrine
@@ -494,7 +493,6 @@ jobs:
494493
run: |
495494
case "${{ matrix.shard }}" in
496495
graphql-doctrine) paths="features/graphql features/doctrine" ;;
497-
misc) paths="features/filter features/issues features/security features/serializer features/http_cache features/sub_resources features/json features/xml features/push_relations features/mercure" ;;
498496
esac
499497
echo "paths=$paths" >> $GITHUB_OUTPUT
500498
- name: Run Behat tests (PHP ${{ matrix.php }} ${{ matrix.shard }})
@@ -824,7 +822,7 @@ jobs:
824822
continue-on-error: true
825823

826824
elasticsearch:
827-
name: Behat (PHP ${{ matrix.php }}) (Elasticsearch ${{ matrix.elasticsearch-version }})
825+
name: PHPUnit (PHP ${{ matrix.php }}) (Elasticsearch ${{ matrix.elasticsearch-version }})
828826
runs-on: ubuntu-22.04
829827
timeout-minutes: 20
830828
strategy:
@@ -888,11 +886,11 @@ jobs:
888886
fi
889887
- name: Clear test app cache
890888
run: tests/Fixtures/app/console cache:clear --ansi
891-
- name: Run Behat tests
892-
run: vendor/bin/behat --out=std --format=progress --profile=elasticsearch --no-interaction
889+
- name: Run PHPUnit tests
890+
run: vendor/bin/phpunit tests/Functional/Elasticsearch/
893891

894892
opensearch:
895-
name: Behat (PHP ${{ matrix.php }}) (OpenSearch ${{ matrix.opensearch-version }})
893+
name: PHPUnit (PHP ${{ matrix.php }}) (OpenSearch ${{ matrix.opensearch-version }})
896894
runs-on: ubuntu-22.04
897895
timeout-minutes: 20
898896
strategy:
@@ -946,8 +944,8 @@ jobs:
946944
composer require --dev opensearch-project/opensearch-php "^2.5" -W
947945
- name: Clear test app cache
948946
run: tests/Fixtures/app/console cache:clear --ansi
949-
- name: Run Behat tests
950-
run: vendor/bin/behat --out=std --format=progress --profile=opensearch --no-interaction
947+
- name: Run PHPUnit tests
948+
run: vendor/bin/phpunit tests/Functional/Elasticsearch/
951949

952950
phpunit-no-deprecations:
953951
name: PHPUnit (PHP ${{ matrix.php }}) (no deprecations)

behat.yml.dist

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -92,36 +92,6 @@ mercure:
9292
filters:
9393
tags: '@mercure'
9494

95-
elasticsearch:
96-
suites:
97-
default: false
98-
elasticsearch: &elasticsearch-suite
99-
paths:
100-
- '%paths.base%/features/elasticsearch'
101-
contexts:
102-
- 'ApiPlatform\Tests\Behat\CommandContext'
103-
- 'ApiPlatform\Tests\Behat\ElasticsearchContext'
104-
- 'ApiPlatform\Tests\Behat\JsonContext'
105-
- 'Behat\MinkExtension\Context\MinkContext'
106-
- 'behatch:context:rest'
107-
filters:
108-
tags: '@elasticsearch&&~@mercure&&~@query_parameter_validator'
109-
110-
opensearch:
111-
suites:
112-
default: false
113-
opensearch:
114-
paths:
115-
- '%paths.base%/features/elasticsearch'
116-
contexts:
117-
- 'ApiPlatform\Tests\Behat\CommandContext'
118-
- 'ApiPlatform\Tests\Behat\ElasticsearchContext'
119-
- 'ApiPlatform\Tests\Behat\JsonContext'
120-
- 'Behat\MinkExtension\Context\MinkContext'
121-
- 'behatch:context:rest'
122-
filters:
123-
tags: '@elasticsearch&&~@mercure&&~@query_parameter_validator'
124-
12595
default-coverage:
12696
suites:
12797
default: &default-coverage-suite
@@ -180,19 +150,6 @@ mercure-coverage:
180150
- 'Behat\MinkExtension\Context\MinkContext'
181151
- 'behatch:context:rest'
182152

183-
elasticsearch-coverage:
184-
suites:
185-
default: false
186-
elasticsearch: &elasticsearch-coverage-suite
187-
<<: *elasticsearch-suite
188-
contexts:
189-
- 'ApiPlatform\Tests\Behat\CommandContext'
190-
- 'ApiPlatform\Tests\Behat\ElasticsearchContext'
191-
- 'ApiPlatform\Tests\Behat\JsonContext'
192-
- 'ApiPlatform\Tests\Behat\CoverageContext'
193-
- 'Behat\MinkExtension\Context\MinkContext'
194-
- 'behatch:context:rest'
195-
196153
legacy:
197154
suites:
198155
default:

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@
130130
"doctrine/common": "^3.2.2",
131131
"doctrine/dbal": "^4.0",
132132
"doctrine/doctrine-bundle": "^2.11 || ^3.1",
133+
"doctrine/mongodb-odm": "^2.16",
134+
"doctrine/mongodb-odm-bundle": "^5.6",
133135
"doctrine/orm": "^2.17 || ^3.0",
134136
"elasticsearch/elasticsearch": "^7.17 || ^8.4 || ^9.0",
135137
"friends-of-behat/mink-browserkit-driver": "^1.3.1",
@@ -146,8 +148,8 @@
146148
"illuminate/support": "^11.0 || ^12.0 || ^13.0",
147149
"jangregor/phpstan-prophecy": "^2.1.11",
148150
"justinrainbow/json-schema": "^6.5.2",
149-
"mcp/sdk": ">=0.4 <1.0",
150151
"laravel/framework": "^11.0 || ^12.0 || ^13.0",
152+
"mcp/sdk": ">=0.4 <1.0",
151153
"orchestra/testbench": "^10.9 || ^11.0",
152154
"phpspec/prophecy-phpunit": "^2.2",
153155
"phpstan/extension-installer": "^1.1",

features/mongodb/deserialize_embed_many_without_target_document.feature

Lines changed: 0 additions & 60 deletions
This file was deleted.

features/mongodb/filters.feature

Lines changed: 0 additions & 27 deletions
This file was deleted.

features/security/README.md

Lines changed: 0 additions & 108 deletions
This file was deleted.

features/security/send_security_headers.feature

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)