Skip to content

Commit cf5ea66

Browse files
committed
fix test
1 parent a672b87 commit cf5ea66

4 files changed

Lines changed: 15 additions & 5 deletions

File tree

phpunit.xml.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.2/phpunit.xsd"
66
backupGlobals="false"
77
colors="true"
8-
bootstrap="vendor/autoload.php"
8+
bootstrap="tests/bootstrap.php"
99
>
1010
<php>
1111
<ini name="error_reporting" value="-1"/>
1212
<server name="KERNEL_CLASS" value="PhpList\Core\Core\ApplicationKernel"/>
13+
<server name="APP_ENV" value="test" force="true"/>
1314
</php>
1415
</phpunit>

tests/Integration/Common/Routing/RoutingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class RoutingTest extends WebTestCase
1616
public function testRootUrlHasHtmlContentType()
1717
{
1818
$client = self::createClient();
19-
$client->request('get', '/api/v2');
19+
$client->request('GET', '/api/v2', server: ['HTTP_ACCEPT' => 'text/html']);
2020

2121
$response = $client->getResponse();
2222

tests/Integration/Composer/ScriptsTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ private function getAbsolutePublicDirectoryPath(): string
2929
public static function publicDirectoryFilesDataProvider(): array
3030
{
3131
return [
32-
'production entry point' => ['app.php'],
33-
'development entry point' => ['app_dev.php'],
34-
'testing entry point' => ['app_test.php'],
32+
'entry point' => ['index.php'],
3533
'.htaccess' => ['.htaccess'],
3634
];
3735
}

tests/bootstrap.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\Dotenv\Dotenv;
6+
7+
require dirname(__DIR__) . '/vendor/autoload.php';
8+
9+
if (method_exists(Dotenv::class, 'bootEnv')) {
10+
(new Dotenv())->bootEnv(dirname(__DIR__) . '/.env');
11+
}

0 commit comments

Comments
 (0)