Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ parameters:
ApiPlatform\Metadata\Resource\ResourceMetadataCollection:
- handleNotFound
ignoreErrors:
# BC shims for the test helpers moved to api-platform/test in 5.0
-
identifier: trait.unused
path: src/Symfony/Bundle/Test/*
# ignore type todo remove in 5.0
-
message: '#Symfony\\Component\\PropertyInfo\\Type#'
Expand Down Expand Up @@ -84,8 +88,6 @@ parameters:
# Expected, due to backward compatibility
- '#Access to an undefined property GraphQL\\Type\\Definition\\NamedType&GraphQL\\Type\\Definition\\Type::\$name\.#'
- "#Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component\\\\\\\\PropertyInfo\\\\\\\\PropertyInfoExtractor' and 'getType' will always evaluate to true\\.#"
- "#Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component\\\\\\\\HttpFoundation\\\\\\\\Request' and 'getContentTypeFormat' will always evaluate to true\\.#"
- '#Call to an undefined method Symfony\\Component\\HttpFoundation\\Request::getContentType\(\)\.#'
- "#Call to function method_exists\\(\\) with 'Symfony\\\\\\\\Component\\\\\\\\Serializer\\\\\\\\Serializer' and 'getSupportedTypes' will always evaluate to true\\.#"
- "#Call to function method_exists\\(\\) with Doctrine\\\\ODM\\\\MongoDB\\\\Mapping\\\\ClassMetadata\\|Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata and 'isChangeTrackingDef…' will always evaluate to true\\.#"
- "#Call to function method_exists\\(\\) with Symfony\\\\Component\\\\Serializer\\\\Exception\\\\PartialDenormalizationException and 'getNotNormalizableV…' will always evaluate to true\\.#"
Expand Down
1 change: 1 addition & 0 deletions src/GraphQl/Tests/Action/EntrypointActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ private function getEntrypointAction(array $variables = ['graphqlVariable']): En

$twigProphecy = $this->prophesize(TwigEnvironment::class);
$twigProphecy->render(Argument::cetera())->willReturn('');
$twigProphecy->getFunction('csp_nonce')->willReturn(null);

$routerProphecy = $this->prophesize(RouterInterface::class);
$routerProphecy->generate('api_graphql_entrypoint')->willReturn('/graphiql');
Expand Down
26 changes: 26 additions & 0 deletions src/Symfony/Bundle/Test/ApiTestAssertionsTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <dunglas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace ApiPlatform\Symfony\Bundle\Test;

use ApiPlatform\Test\ApiTestAssertionsTrait as BaseApiTestAssertionsTrait;

trigger_deprecation('api-platform/core', '5.0', 'The "%s" trait is deprecated, use "%s" instead.', ApiTestAssertionsTrait::class, BaseApiTestAssertionsTrait::class);

/**
* @deprecated since API Platform 5.0, use {@see BaseApiTestAssertionsTrait} instead
*/
trait ApiTestAssertionsTrait
{
use BaseApiTestAssertionsTrait;
}
25 changes: 25 additions & 0 deletions src/Symfony/Bundle/Test/ApiTestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <dunglas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace ApiPlatform\Symfony\Bundle\Test;

use ApiPlatform\Test\ApiTestCase as BaseApiTestCase;

trigger_deprecation('api-platform/core', '5.0', 'The "%s" class is deprecated, use "%s" instead.', ApiTestCase::class, BaseApiTestCase::class);

/**
* @deprecated since API Platform 5.0, use {@see BaseApiTestCase} instead
*/
abstract class ApiTestCase extends BaseApiTestCase
{
}
20 changes: 20 additions & 0 deletions src/Symfony/Bundle/Test/Client.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <dunglas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace ApiPlatform\Symfony\Bundle\Test;

use ApiPlatform\Test\Client;

trigger_deprecation('api-platform/core', '5.0', 'The "%s" class is deprecated, use "%s" instead.', 'ApiPlatform\Symfony\Bundle\Test\Client', Client::class);

class_alias(Client::class, 'ApiPlatform\Symfony\Bundle\Test\Client');
26 changes: 26 additions & 0 deletions src/Symfony/Bundle/Test/ClientTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <dunglas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace ApiPlatform\Symfony\Bundle\Test;

use ApiPlatform\Test\ClientTrait as BaseClientTrait;

trigger_deprecation('api-platform/core', '5.0', 'The "%s" trait is deprecated, use "%s" instead.', ClientTrait::class, BaseClientTrait::class);

/**
* @deprecated since API Platform 5.0, use {@see BaseClientTrait} instead
*/
trait ClientTrait
{
use BaseClientTrait;
}
20 changes: 20 additions & 0 deletions src/Symfony/Bundle/Test/Constraint/ArraySubset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <dunglas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace ApiPlatform\Symfony\Bundle\Test\Constraint;

use ApiPlatform\Test\Constraint\ArraySubset;

trigger_deprecation('api-platform/core', '5.0', 'The "%s" class is deprecated, use "%s" instead.', 'ApiPlatform\Symfony\Bundle\Test\Constraint\ArraySubset', ArraySubset::class);

class_alias(ArraySubset::class, 'ApiPlatform\Symfony\Bundle\Test\Constraint\ArraySubset');
26 changes: 26 additions & 0 deletions src/Symfony/Bundle/Test/Constraint/ArraySubsetTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <dunglas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace ApiPlatform\Symfony\Bundle\Test\Constraint;

use ApiPlatform\Test\Constraint\ArraySubsetTrait as BaseArraySubsetTrait;

trigger_deprecation('api-platform/core', '5.0', 'The "%s" trait is deprecated, use "%s" instead.', ArraySubsetTrait::class, BaseArraySubsetTrait::class);

/**
* @deprecated since API Platform 5.0, use {@see BaseArraySubsetTrait} instead
*/
trait ArraySubsetTrait
{
use BaseArraySubsetTrait;
}
20 changes: 20 additions & 0 deletions src/Symfony/Bundle/Test/Constraint/MatchesJsonSchema.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <dunglas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace ApiPlatform\Symfony\Bundle\Test\Constraint;

use ApiPlatform\Test\Constraint\MatchesJsonSchema;

trigger_deprecation('api-platform/core', '5.0', 'The "%s" class is deprecated, use "%s" instead.', 'ApiPlatform\Symfony\Bundle\Test\Constraint\MatchesJsonSchema', MatchesJsonSchema::class);

class_alias(MatchesJsonSchema::class, 'ApiPlatform\Symfony\Bundle\Test\Constraint\MatchesJsonSchema');
20 changes: 20 additions & 0 deletions src/Symfony/Bundle/Test/Response.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

/*
* This file is part of the API Platform project.
*
* (c) Kévin Dunglas <dunglas@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

declare(strict_types=1);

namespace ApiPlatform\Symfony\Bundle\Test;

use ApiPlatform\Test\Response;

trigger_deprecation('api-platform/core', '5.0', 'The "%s" class is deprecated, use "%s" instead.', 'ApiPlatform\Symfony\Bundle\Test\Response', Response::class);

class_alias(Response::class, 'ApiPlatform\Symfony\Bundle\Test\Response');
2 changes: 2 additions & 0 deletions src/Symfony/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@
"api-platform/metadata": "^5.0@alpha",
"api-platform/serializer": "^5.0@alpha",
"api-platform/state": "^5.0@alpha",
"api-platform/test": "^5.0@alpha",
"api-platform/validator": "^5.0@alpha",
"api-platform/openapi": "^5.0@alpha",
"symfony/asset": "^7.4 || ^8.0",
"symfony/deprecation-contracts": "^3.1",
"symfony/finder": "^7.4 || ^8.0",
"symfony/http-kernel": "^7.4 || ^8.0",
"symfony/property-info": "^7.4 || ^8.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace ApiPlatform\Tests\Functional\Doctrine;

use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
use ApiPlatform\Test\ApiTestCase;
use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Issue8113\BarJoined;
use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Issue8113\BarJoinedA;
use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Issue8113\BarJoinedB;
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/GraphQl/GraphiqlCspNonceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace ApiPlatform\Tests\Functional\GraphQl;

use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
use ApiPlatform\Test\ApiTestCase;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Event\RequestEvent;
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/McpExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace ApiPlatform\Tests\Functional;

use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
use ApiPlatform\Test\ApiTestCase;
use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\McpExceptionTools;
use ApiPlatform\Tests\RecreateSchemaTrait;
use ApiPlatform\Tests\SetupClassResourcesTrait;
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Parameters/ChainFilterMongoDbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace ApiPlatform\Tests\Functional\Parameters;

use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
use ApiPlatform\Test\ApiTestCase;
use ApiPlatform\Tests\Fixtures\TestBundle\Document\ChainFilterParameter;
use ApiPlatform\Tests\RecreateSchemaTrait;
use ApiPlatform\Tests\SetupClassResourcesTrait;
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Parameters/ChainFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace ApiPlatform\Tests\Functional\Parameters;

use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
use ApiPlatform\Test\ApiTestCase;
use ApiPlatform\Tests\Fixtures\TestBundle\Entity\ChainFilterParameter;
use ApiPlatform\Tests\RecreateSchemaTrait;
use ApiPlatform\Tests\SetupClassResourcesTrait;
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Parameters/ParameterOnPropertiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace ApiPlatform\Tests\Functional\Parameters;

use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
use ApiPlatform\Test\ApiTestCase;
use ApiPlatform\Tests\Fixtures\TestBundle\Document\ParameterOnProperties as DocumentParameterOnProperties;
use ApiPlatform\Tests\Fixtures\TestBundle\Document\ParameterOnPropertiesWithHeaderParameter as DocumentParameterOnPropertiesWithHeaderParameter;
use ApiPlatform\Tests\Fixtures\TestBundle\Entity\ParameterOnProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace ApiPlatform\Tests\Functional\Parameters;

use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
use ApiPlatform\Test\ApiTestCase;
use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\WriteUriVariableLinkResource;
use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Base64UriVariableDummy;
use ApiPlatform\Tests\Fixtures\TestBundle\Entity\Dummy;
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/RepeatedDefaultParametersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace ApiPlatform\Tests\Functional;

use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
use ApiPlatform\Test\ApiTestCase;

final class RepeatedDefaultParametersTest extends ApiTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace ApiPlatform\Tests\Functional\Serializer;

use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
use ApiPlatform\Test\ApiTestCase;
use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\EmbeddedRelationNativeType\EmbeddedRelationChild;
use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\EmbeddedRelationNativeType\EmbeddedRelationParent;
use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\EmbeddedRelationNativeType\EmbeddedRelationTarget;
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/Serializer/SharedRouteIriTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace ApiPlatform\Tests\Functional\Serializer;

use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
use ApiPlatform\Test\ApiTestCase;
use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\SharedRouteIri\CategoryProjection;
use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\SharedRouteIri\CategoryResource;
use ApiPlatform\Tests\Fixtures\TestBundle\ApiResource\SharedRouteIri\TopicResource;
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/SwaggerUiCspNonceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace ApiPlatform\Tests\Functional;

use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
use ApiPlatform\Test\ApiTestCase;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Event\RequestEvent;
Expand Down
Loading