diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 170b9894..fa1d96c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,6 +73,7 @@ jobs: export PHPLIST_DATABASE_PASSWORD=${{ env.DB_PASSWORD }} export PHPLIST_DATABASE_PORT=${{ job.services.mysql.ports['3306'] }} export PHPLIST_DATABASE_HOST=127.0.0.1 + export PHPLIST_DATABASE_PATH= vendor/bin/phpunit tests/Integration/ continue-on-error: ${{matrix.php-versions == '8.0' }} # [temp-php8] - name: Running static analysis diff --git a/.gitignore b/.gitignore index 2c98e37b..a2318880 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ /var/ /vendor/ .phpunit.result.cache +.env +.env.dist diff --git a/composer.json b/composer.json index 17764d64..c989bd19 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ }, "require": { "php": "^8.1", - "phplist/core": "dev-main", + "phplist/core": "dev-env", "friendsofsymfony/rest-bundle": "*", "symfony/test-pack": "^1.0", "symfony/process": "^6.4", @@ -85,6 +85,7 @@ "PhpList\\Core\\Composer\\ScriptHandler::createGeneralConfiguration", "PhpList\\Core\\Composer\\ScriptHandler::createBundleConfiguration", "PhpList\\Core\\Composer\\ScriptHandler::createRoutesConfiguration", + "PhpList\\Core\\Composer\\ScriptHandler::createDotenvConfiguration", "PhpList\\Core\\Composer\\ScriptHandler::createParametersConfiguration", "PhpList\\Core\\Composer\\ScriptHandler::clearAllCaches" ], diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 78ea4f9a..692cf4d0 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -5,10 +5,11 @@ xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.2/phpunit.xsd" backupGlobals="false" colors="true" - bootstrap="vendor/autoload.php" + bootstrap="tests/bootstrap.php" > + diff --git a/tests/Integration/Common/Routing/RoutingTest.php b/tests/Integration/Common/Routing/RoutingTest.php index cfbe3cc3..bbab5c77 100644 --- a/tests/Integration/Common/Routing/RoutingTest.php +++ b/tests/Integration/Common/Routing/RoutingTest.php @@ -16,7 +16,7 @@ class RoutingTest extends WebTestCase public function testRootUrlHasHtmlContentType() { $client = self::createClient(); - $client->request('get', '/api/v2'); + $client->request('GET', '/api/v2', server: ['HTTP_ACCEPT' => 'text/html']); $response = $client->getResponse(); diff --git a/tests/Integration/Composer/ScriptsTest.php b/tests/Integration/Composer/ScriptsTest.php index 5b0df800..2cd0691b 100644 --- a/tests/Integration/Composer/ScriptsTest.php +++ b/tests/Integration/Composer/ScriptsTest.php @@ -29,9 +29,7 @@ private function getAbsolutePublicDirectoryPath(): string public static function publicDirectoryFilesDataProvider(): array { return [ - 'production entry point' => ['app.php'], - 'development entry point' => ['app_dev.php'], - 'testing entry point' => ['app_test.php'], + 'entry point' => ['index.php'], '.htaccess' => ['.htaccess'], ]; } diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 00000000..8a148f7f --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,11 @@ +bootEnv(dirname(__DIR__) . '/.env'); +}