Skip to content

Commit efe7333

Browse files
committed
chore(test): move fixtures and tests
1 parent 7606486 commit efe7333

File tree

804 files changed

+1518
-1631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

804 files changed

+1518
-1631
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@
118118
},
119119
"autoload-dev": {
120120
"psr-4": {
121-
"ApiPlatform\\Core\\Tests\\": "tests/",
121+
"ApiPlatform\\Core\\Tests\\": "tests/Core/",
122+
"ApiPlatform\\Tests\\": "tests/",
122123
"App\\": "tests/Fixtures/app/var/tmp/src/"
123124
}
124125
},

features/doctrine/eager_loading.feature

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Feature: Eager Loading
1212
And the DQL should be equal to:
1313
"""
1414
SELECT o, thirdLevel_a1, relatedToDummyFriend_a2, dummyFriend_a3
15-
FROM ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\RelatedDummy o
15+
FROM ApiPlatform\Tests\Fixtures\TestBundle\Entity\RelatedDummy o
1616
LEFT JOIN o.thirdLevel thirdLevel_a1
1717
LEFT JOIN o.relatedToDummyFriend relatedToDummyFriend_a2
1818
LEFT JOIN relatedToDummyFriend_a2.dummyFriend dummyFriend_a3
@@ -26,12 +26,12 @@ Feature: Eager Loading
2626
And the DQL should be equal to:
2727
"""
2828
SELECT o
29-
FROM ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Dummy o
29+
FROM ApiPlatform\Tests\Fixtures\TestBundle\Entity\Dummy o
3030
INNER JOIN o.relatedDummy relatedDummy_a1
3131
INNER JOIN relatedDummy_a1.thirdLevel thirdLevel_a2
3232
WHERE o IN(
3333
SELECT o_a3
34-
FROM ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Dummy o_a3
34+
FROM ApiPlatform\Tests\Fixtures\TestBundle\Entity\Dummy o_a3
3535
INNER JOIN o_a3.relatedDummy relatedDummy_a4
3636
INNER JOIN relatedDummy_a4.thirdLevel thirdLevel_a5
3737
WHERE thirdLevel_a5.level = :level_p1
@@ -46,13 +46,13 @@ Feature: Eager Loading
4646
And the DQL should be equal to:
4747
"""
4848
SELECT o, thirdLevel_a4, relatedToDummyFriend_a1, dummyFriend_a5
49-
FROM ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\RelatedDummy o
49+
FROM ApiPlatform\Tests\Fixtures\TestBundle\Entity\RelatedDummy o
5050
INNER JOIN o.relatedToDummyFriend relatedToDummyFriend_a1
5151
LEFT JOIN o.thirdLevel thirdLevel_a4
5252
INNER JOIN relatedToDummyFriend_a1.dummyFriend dummyFriend_a5
5353
WHERE o IN(
5454
SELECT o_a2
55-
FROM ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\RelatedDummy o_a2
55+
FROM ApiPlatform\Tests\Fixtures\TestBundle\Entity\RelatedDummy o_a2
5656
INNER JOIN o_a2.relatedToDummyFriend relatedToDummyFriend_a3
5757
WHERE relatedToDummyFriend_a3.dummyFriend = :dummyFriend_p1
5858
)
@@ -69,7 +69,7 @@ Feature: Eager Loading
6969
And the DQL should be equal to:
7070
"""
7171
SELECT o, car_a1, passenger_a2
72-
FROM ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\DummyTravel o
72+
FROM ApiPlatform\Tests\Fixtures\TestBundle\Entity\DummyTravel o
7373
LEFT JOIN o.car car_a1
7474
LEFT JOIN o.passenger passenger_a2
7575
WHERE o.id = :id_id
@@ -82,13 +82,13 @@ Feature: Eager Loading
8282
And the DQL should be equal to:
8383
"""
8484
SELECT o, thirdLevel_a3, relatedToDummyFriend_a4, dummyFriend_a5
85-
FROM ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\RelatedDummy o
85+
FROM ApiPlatform\Tests\Fixtures\TestBundle\Entity\RelatedDummy o
8686
LEFT JOIN o.thirdLevel thirdLevel_a3
8787
LEFT JOIN o.relatedToDummyFriend relatedToDummyFriend_a4
8888
LEFT JOIN relatedToDummyFriend_a4.dummyFriend dummyFriend_a5
8989
WHERE o.id IN (
9090
SELECT related_dummy_a1.id
91-
FROM ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\RelatedDummy related_dummy_a1
91+
FROM ApiPlatform\Tests\Fixtures\TestBundle\Entity\RelatedDummy related_dummy_a1
9292
INNER JOIN related_dummy_a1.relatedToDummyFriend related_to_dummy_friend_a2
9393
WITH related_to_dummy_friend_a2.name = :name_p1
9494
)

features/main/relation.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ Feature: Relations support
502502
"pattern": "^An error occurred$"
503503
},
504504
"hydra:description": {
505-
"pattern": "^Expected IRI or document for resource \"ApiPlatform\\\\Core\\\\Tests\\\\Fixtures\\\\TestBundle\\\\(Document|Entity)\\\\RelatedDummy\", \"integer\" given.$"
505+
"pattern": "^Expected IRI or document for resource \"ApiPlatform\\\\Tests\\\\Fixtures\\\\TestBundle\\\\(Document|Entity)\\\\RelatedDummy\", \"integer\" given.$"
506506
}
507507
},
508508
"required": [

features/serializer/vo_relations.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Feature: Value object as ApiResource
135135
"pattern": "^An error occurred$"
136136
},
137137
"hydra:description": {
138-
"pattern": "^Cannot create an instance of ApiPlatform\\\\Core\\\\Tests\\\\Fixtures\\\\TestBundle\\\\(Document|Entity)\\\\VoDummyCar from serialized data because its constructor requires parameter \"drivers\" to be present.$"
138+
"pattern": "^Cannot create an instance of ApiPlatform\\\\Tests\\\\Fixtures\\\\TestBundle\\\\(Document|Entity)\\\\VoDummyCar from serialized data because its constructor requires parameter \"drivers\" to be present.$"
139139
}
140140
},
141141
"required": [

phpstan.neon.dist

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ parameters:
1818
- tests/Fixtures/app/var/cache
1919
# Deprecated integrations (will be removed in API Platform 3)
2020
- src/Core/Bridge/NelmioApiDoc/*
21-
- tests/Bridge/NelmioApiDoc/*
21+
- tests/Core/Bridge/NelmioApiDoc/*
2222
- src/Core/Bridge/FosUser/*
2323
# BC layer
24-
- tests/Bridge/Symfony/Bundle/DependencyInjection/Compiler/AnnotationFilterPassTest.php
25-
- tests/Annotation/ApiResourceTest.php
26-
- tests/Annotation/ApiPropertyTest.php
27-
- tests/Metadata/Resource/Factory/AnnotationResourceMetadataFactoryTest.php
24+
- tests/Core/Bridge/Symfony/Bundle/DependencyInjection/Compiler/AnnotationFilterPassTest.php
25+
- tests/Core/Annotation/ApiResourceTest.php
26+
- tests/Core/Annotation/ApiPropertyTest.php
27+
- tests/Core/Metadata/Resource/Factory/AnnotationResourceMetadataFactoryTest.php
2828
- tests/Fixtures/TestBundle/BrowserKit/Client.php
2929
# The Symfony Configuration API isn't good enough to be analysed
3030
- src/Core/Bridge/Symfony/Bundle/DependencyInjection/Configuration.php
3131
# Phpstan runs on phpunit > 9, a signature changed in this file
3232
- src/Core/Bridge/Symfony/Bundle/Test/Constraint/ArraySubsetLegacy.php
3333
# Imported code (temporary)
3434
- src/Core/Bridge/Symfony/Bundle/Test/BrowserKitAssertionsTrait.php
35-
- tests/Bridge/Symfony/Bundle/Test/WebTestCaseTest.php
36-
- tests/ProphecyTrait.php
37-
- tests/Behat/CoverageContext.php
35+
- tests/Core/Bridge/Symfony/Bundle/Test/WebTestCaseTest.php
36+
- tests/Core/ProphecyTrait.php
37+
- tests/Core/Behat/CoverageContext.php
3838
- tests/Fixtures/TestBundle/Security/AbstractSecurityUser.php
3939
# Templates for Maker
4040
- src/Core/Bridge/Symfony/Maker/Resources/skeleton
@@ -53,7 +53,7 @@ parameters:
5353
-
5454
message: "#Parameter \\#2 \\$dqlPart of method Doctrine\\\\ORM\\\\QueryBuilder::add\\(\\) expects array<'join'\\|int, array<int\\|string, object>\\|string>\\|object\\|string, array\\('o' => Doctrine\\\\ORM\\\\Query\\\\Expr\\\\Join\\) given\\.#"
5555
paths:
56-
- tests/Bridge/Doctrine/Orm/Extension/FilterEagerLoadingExtensionTest.php
56+
- tests/Core/Bridge/Doctrine/Orm/Extension/FilterEagerLoadingExtensionTest.php
5757
- '#Parameter \#1 \$function of function call_user_func expects callable\(\): mixed, non-empty-string given\.#'
5858
-
5959
message: '#Strict comparison using !== between .+ and .+ will always evaluate to false\.#'
@@ -73,27 +73,27 @@ parameters:
7373
-
7474
message: '#Parameter \#[0-9] \$filterLocator of class .+ constructor expects ApiPlatform\\Core\\Api\\FilterCollection|Psr\\Container\\ContainerInterface, ArrayObject<mixed, mixed> given\.#'
7575
paths:
76-
- tests/Bridge/Doctrine/Orm/Extension/FilterExtensionTest.php
77-
- tests/Hydra/Serializer/CollectionFiltersNormalizerTest.php
78-
- tests/Swagger/Serializer/DocumentationNormalizerV2Test.php
79-
- tests/Swagger/Serializer/DocumentationNormalizerV3Test.php
76+
- tests/Core/Bridge/Doctrine/Orm/Extension/FilterExtensionTest.php
77+
- tests/Core/Hydra/Serializer/CollectionFiltersNormalizerTest.php
78+
- tests/Core/Swagger/Serializer/DocumentationNormalizerV2Test.php
79+
- tests/Core/Swagger/Serializer/DocumentationNormalizerV3Test.php
8080
-
8181
message: '#Parameter \#1 \$objectValue of method GraphQL\\Type\\Definition\\InterfaceType::resolveType\(\) expects object, array(<string, string>)? given.#'
8282
path: tests/GraphQl/Type/TypeBuilderTest.php
8383
# https://github.com/phpstan/phpstan-doctrine/issues/115
8484
-
85-
message: '#Property ApiPlatform\\Core\\Test\\DoctrineMongoDbOdmFilterTestCase::\$repository \(Doctrine\\ODM\\MongoDB\\Repository\\DocumentRepository\) does not accept Doctrine\\ORM\\EntityRepository<ApiPlatform\\Core\\Tests\\Fixtures\\TestBundle\\Document\\Dummy>\.#'
85+
message: '#Property ApiPlatform\\Core\\Test\\DoctrineMongoDbOdmFilterTestCase::\$repository \(Doctrine\\ODM\\MongoDB\\Repository\\DocumentRepository\) does not accept Doctrine\\ORM\\EntityRepository<ApiPlatform\\Tests\\Fixtures\\TestBundle\\Document\\Dummy>\.#'
8686
path: src/Core/Test/DoctrineMongoDbOdmFilterTestCase.php
8787
-
8888
message: "#Call to method PHPUnit\\\\Framework\\\\Assert::assertSame\\(\\) with array\\('(collection_context|item_context|subresource_context)'\\) and array<Symfony\\\\Component\\\\VarDumper\\\\Cloner\\\\Data>\\|bool\\|float\\|int\\|string\\|null will always evaluate to false\\.#"
89-
path: tests/Bridge/Symfony/Bundle/DataCollector/RequestDataCollectorTest.php
89+
path: tests/Core/Bridge/Symfony/Bundle/DataCollector/RequestDataCollectorTest.php
9090
# https://github.com/phpstan/phpstan-phpunit/issues/62
9191
-
9292
message: '#Call to method PHPUnit\\Framework\\Assert::assertSame\(\) with 2 and int will always evaluate to false\.#'
93-
path: tests/Identifier/Normalizer/IntegerDenormalizerTest.php
93+
path: tests/Core/Identifier/Normalizer/IntegerDenormalizerTest.php
9494
-
9595
message: '#Call to method PHPUnit\\Framework\\Assert::assertSame\(\) with array\(.+\) and array\(.+\) will always evaluate to false\.#'
96-
path: tests/Util/SortTraitTest.php
96+
path: tests/Core/Util/SortTraitTest.php
9797
# https://github.com/phpstan/phpstan-symfony/issues/76
9898
-
9999
message: '#Service "test" is not registered in the container\.#'
@@ -124,4 +124,4 @@ parameters:
124124
# Expected, due to backward compatibility
125125
-
126126
message: "#Call to function method_exists\\(\\) with ApiPlatform\\\\Core\\\\JsonApi\\\\Serializer\\\\ItemNormalizer and 'setCircularReferenc…' will always evaluate to false\\.#"
127-
path: tests/JsonApi/Serializer/ItemNormalizerTest.php
127+
path: tests/Core/JsonApi/Serializer/ItemNormalizerTest.php
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/Annotation/ApiFilterTest.php renamed to tests/Core/Annotation/ApiFilterTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
namespace ApiPlatform\Core\Tests\Annotation;
1515

1616
use ApiPlatform\Core\Annotation\ApiFilter;
17-
use ApiPlatform\Core\Tests\Fixtures\DummyFilter;
18-
use ApiPlatform\Core\Tests\Fixtures\TestBundle\Entity\Dummy;
17+
use ApiPlatform\Tests\Fixtures\DummyFilter;
18+
use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Dummy;
1919
use PHPUnit\Framework\TestCase;
2020

2121
/**
@@ -34,7 +34,7 @@ public function testInvalidConstructor()
3434
public function testInvalidFilter()
3535
{
3636
$this->expectException(\InvalidArgumentException::class);
37-
$this->expectExceptionMessage('The filter class "ApiPlatform\\Core\\Tests\\Fixtures\\TestBundle\\Entity\\Dummy" does not implement "ApiPlatform\\Core\\Api\\FilterInterface". Did you forget a use statement?');
37+
$this->expectExceptionMessage('The filter class "ApiPlatform\\Tests\\Fixtures\\TestBundle\\Entity\\Dummy" does not implement "ApiPlatform\\Core\\Api\\FilterInterface". Did you forget a use statement?');
3838

3939
new ApiFilter(['value' => Dummy::class]); // @phpstan-ignore-line
4040
}
@@ -63,7 +63,7 @@ public function testAssignation()
6363
public function testAssignationAttribute()
6464
{
6565
$filter = eval(<<<'PHP'
66-
return new \ApiPlatform\Core\Annotation\ApiFilter(\ApiPlatform\Core\Tests\Fixtures\DummyFilter::class, strategy: 'test', properties: ['one', 'two'], arguments: ['args']);
66+
return new \ApiPlatform\Core\Annotation\ApiFilter(\ApiPlatform\Tests\Fixtures\DummyFilter::class, strategy: 'test', properties: ['one', 'two'], arguments: ['args']);
6767
PHP
6868
);
6969

File renamed without changes.

0 commit comments

Comments
 (0)