Skip to content

Commit

Permalink
#11 fix: tests
Browse files Browse the repository at this point in the history
Signed-off-by: Patrizio Bekerle <[email protected]>
  • Loading branch information
pbek committed Sep 15, 2024
1 parent 622aed0 commit 8c98202
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 35 deletions.
2 changes: 0 additions & 2 deletions config/packages/test/framework.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
framework:
test: true
session:
storage_id: session.storage.mock_file
2 changes: 0 additions & 2 deletions config/packages/test/twig.yaml

This file was deleted.

3 changes: 0 additions & 3 deletions config/packages/test/validator.yaml

This file was deleted.

37 changes: 12 additions & 25 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,34 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="bin/.phpunit/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="tests/bootstrap.php"
>
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="tests/bootstrap.php" cacheDirectory=".phpunit.cache">
<php>
<ini name="error_reporting" value="-1" />
<server name="APP_ENV" value="test" force="true" />
<server name="SHELL_VERBOSITY" value="-1" />
<server name="SYMFONY_PHPUNIT_REMOVE" value="" />
<server name="SYMFONY_PHPUNIT_VERSION" value="8" />
<server name="KERNEL_CLASS" value="App\Kernel" />
<ini name="error_reporting" value="-1"/>
<server name="APP_ENV" value="test" force="true"/>
<server name="SHELL_VERBOSITY" value="-1"/>
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=3&amp;quiet[]=indirect"/>
</php>

<testsuites>
<testsuite name="Project Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
<source>
<include>
<directory>src</directory>
<directory>tests</directory>
</include>
</source>
</phpunit>
6 changes: 3 additions & 3 deletions tests/LatestReleaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Tests;

use ApiPlatform\Core\Bridge\Symfony\Bundle\Test\ApiTestCase;
use ApiPlatform\Symfony\Bundle\Test\ApiTestCase;
use App\Entity\LatestRelease;

class LatestReleaseTest extends ApiTestCase
Expand Down Expand Up @@ -33,7 +33,7 @@ public function testGetCollection(): void

public function testGetItem(): void
{
$response = static::createClient()->request('GET', '/latest_releases/linux');
static::createClient()->request('GET', '/latest_releases/linux');

$this->assertResponseStatusCodeSame(200);
$this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8');
Expand All @@ -44,4 +44,4 @@ public function testGetItem(): void
]);
$this->assertMatchesResourceItemJsonSchema(LatestRelease::class);
}
}
}

0 comments on commit 8c98202

Please sign in to comment.