Skip to content

Commit 8821f07

Browse files
committed
test
1 parent 85bce2a commit 8821f07

File tree

5 files changed

+40
-12
lines changed

5 files changed

+40
-12
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ jobs:
140140
rm -Rf tests/Fixtures/app/var/cache/*
141141
tests/Fixtures/app/console cache:warmup
142142
- name: Run PHPStan analysis
143-
env:
144-
SYMFONY_PHPUNIT_VERSION: '9.5'
145143
run: |
146144
./vendor/bin/phpstan --version
147145
./vendor/bin/phpstan analyse --no-interaction --no-progress --ansi
@@ -766,8 +764,6 @@ jobs:
766764
restore-keys: ${{ runner.os }}-composer-
767765
- name: Update project dependencies
768766
run: composer update --prefer-lowest --no-interaction --no-progress --ansi
769-
- name: Install PHPUnit
770-
run: vendor/bin/simple-phpunit --version
771767
- name: Clear test app cache
772768
run: tests/Fixtures/app/console cache:clear --ansi
773769
- name: Run Behat tests
@@ -1031,12 +1027,10 @@ jobs:
10311027
run: rm -Rf tests/Fixtures/app/var/cache/*
10321028
- name: Update project dependencies
10331029
run: composer update --prefer-lowest --no-interaction --no-progress --ansi
1034-
- name: Install PHPUnit
1035-
run: vendor/bin/simple-phpunit --version
10361030
- name: Clear test app cache
10371031
run: tests/Fixtures/app/console cache:clear --ansi
10381032
- name: Run PHPUnit tests
1039-
run: vendor/bin/simple-phpunit
1033+
run: vendor/bin/phpunit
10401034
env:
10411035
SYMFONY_DEPRECATIONS_HELPER: max[self]=0&ignoreFile=./tests/.ignored-deprecations
10421036

@@ -1075,8 +1069,6 @@ jobs:
10751069
run: rm -Rf tests/Fixtures/app/var/cache/*
10761070
- name: Update project dependencies
10771071
run: composer update --prefer-lowest --no-interaction --no-progress --ansi
1078-
- name: Install PHPUnit
1079-
run: vendor/bin/simple-phpunit --version
10801072
- name: Clear test app cache
10811073
run: tests/Fixtures/app/console cache:clear --ansi
10821074
- name: Run Behat tests

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"phpstan/phpstan-doctrine": "^1.0",
6262
"phpstan/phpstan-phpunit": "^1.0",
6363
"phpstan/phpstan-symfony": "^1.0",
64-
"phpunit/phpunit": "^9.5",
64+
"phpunit/phpunit": "^9.6",
6565
"psr/log": "^1.0 || ^2.0 || ^3.0",
6666
"ramsey/uuid": "^3.9.7 || ^4.0",
6767
"ramsey/uuid-doctrine": "^1.4 || ^2.0",
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the API Platform project.
5+
*
6+
* (c) Kévin Dunglas <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace ApiPlatform\Doctrine\Odm\State;
15+
16+
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
17+
use Doctrine\Persistence\ManagerRegistry;
18+
use Doctrine\ODM\MongoDB\Aggregation\Builder;
19+
20+
final class LinksHandler implements LinksHandlerInterface
21+
{
22+
use LinksHandlerTrait {
23+
handleLinks as private handle;
24+
}
25+
26+
public function __construct(ResourceMetadataCollectionFactoryInterface $resourceMetadataCollectionFactory, ManagerRegistry $managerRegistry)
27+
{
28+
$this->resourceMetadataCollectionFactory = $resourceMetadataCollectionFactory;
29+
$this->managerRegistry = $managerRegistry;
30+
}
31+
32+
public function handleLinks(Builder $aggregationBuilder, array $uriVariables, array $context): void
33+
{
34+
$this->handle($aggregationBuilder, $uriVariables, $context, $context['documentClass'], $context['operation']);
35+
}
36+
}

src/Doctrine/Odm/State/LinksHandlerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface LinksHandlerInterface
2727
* @see LinksHandlerTrait
2828
*
2929
* @param array<string, mixed> $uriVariables
30-
* @param array{entityClass: string, operation: Operation}&array<string, mixed> $context
30+
* @param array{documentClass: string, operation: Operation}&array<string, mixed> $context
3131
*/
3232
public function handleLinks(Builder $aggregationBuilder, array $uriVariables, array $context): void;
3333
}

tests/Symfony/Validator/ValidationExceptionListenerTest.php renamed to tests/Symfony/Validator/EventListener/ValidationExceptionListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
declare(strict_types=1);
1313

14-
namespace ApiPlatform\Tests\Symfony\Validator;
14+
namespace ApiPlatform\Tests\Symfony\Validator\EventListener;
1515

1616
use ApiPlatform\Exception\FilterValidationException;
1717
use ApiPlatform\Symfony\Validator\EventListener\ValidationExceptionListener;

0 commit comments

Comments
 (0)