-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EasyApiPlatform] Refactor tests (#1391)
- Loading branch information
Showing
32 changed files
with
266 additions
and
544 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
27 changes: 0 additions & 27 deletions
27
packages/EasyApiPlatform/src/Bridge/Symfony/Listeners/OperationRequestInitiatorTrait.php
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace EonX\EasyApiPlatform\Tests; | ||
|
||
use ApiPlatform\Symfony\Bundle\Test\ApiTestCase; | ||
use ApiPlatform\Symfony\Bundle\Test\Client; | ||
use Doctrine\ORM\EntityManagerInterface; | ||
use Doctrine\ORM\Tools\SchemaTool; | ||
use EonX\EasyApiPlatform\Tests\Fixtures\App\Kernel\ApplicationKernel; | ||
use EonX\EasyTest\Traits\ArrayAssertionTrait; | ||
use EonX\EasyTest\Traits\ContainerServiceTrait; | ||
use EonX\EasyTest\Traits\PrivatePropertyAccessTrait; | ||
use Symfony\Component\HttpKernel\KernelInterface; | ||
|
||
abstract class AbstractApiTestCase extends ApiTestCase | ||
{ | ||
use ArrayAssertionTrait; | ||
use ContainerServiceTrait; | ||
use PrivatePropertyAccessTrait; | ||
|
||
protected static Client $client; | ||
|
||
protected function setUp(): void | ||
{ | ||
static::$client = static::createClient( | ||
[], | ||
[ | ||
'headers' => ['accept' => ['application/json']], | ||
] | ||
); | ||
} | ||
|
||
protected static function createKernel(array $options = []): KernelInterface | ||
{ | ||
return new ApplicationKernel('test', false); | ||
} | ||
|
||
protected function initDatabase(): void | ||
{ | ||
$entityManager = self::getService(EntityManagerInterface::class); | ||
$metaData = $entityManager->getMetadataFactory() | ||
->getAllMetadata(); | ||
$schemaTool = new SchemaTool($entityManager); | ||
$schemaTool->dropSchema($metaData); | ||
$schemaTool->updateSchema($metaData); | ||
} | ||
} |
This file contains 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
25 changes: 0 additions & 25 deletions
25
packages/EasyApiPlatform/tests/Bridge/Symfony/AbstractSymfonyTestCase.php
This file was deleted.
Oops, something went wrong.
83 changes: 0 additions & 83 deletions
83
packages/EasyApiPlatform/tests/Bridge/Symfony/Listeners/HttpKernelViewEventListenerTest.php
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.