Skip to content

Commit

Permalink
test: Fixed tests directory
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Mar 12, 2024
1 parent 2ee163a commit cdb147d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ parameters:
- */node_modules/*
- */bower_components/*
- */static/*
doctrine:
repositoryClass: RZ\Roadiz\CoreBundle\Repository\EntityRepository
objectManagerLoader: ./tests/object-manager.php
ignoreErrors:
- '#Call to an undefined method RZ\\Roadiz\\CoreBundle\\Repository#'
- '#Call to an undefined method RZ\\Roadiz\\UserBundle\\Repository#'
Expand All @@ -32,5 +35,7 @@ parameters:
reportUnmatchedIgnoredErrors: false
checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
treatPhpDocTypesAsCertain: false
includes:
- vendor/phpstan/phpstan-doctrine/extension.neon
- vendor/phpstan/phpstan-doctrine/rules.neon
11 changes: 11 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

use Symfony\Component\Dotenv\Dotenv;

require dirname(__DIR__).'/vendor/autoload.php';

if (file_exists(dirname(__DIR__).'/config/bootstrap.php')) {
require dirname(__DIR__).'/config/bootstrap.php';
} elseif (method_exists(Dotenv::class, 'bootEnv')) {
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
}
11 changes: 11 additions & 0 deletions tests/object-manager.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
use App\Kernel;
use Symfony\Component\Dotenv\Dotenv;

require __DIR__ . '/../vendor/autoload.php';

(new Dotenv())->bootEnv(__DIR__ . '/../.env');

$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$kernel->boot();
return $kernel->getContainer()->get('doctrine')->getManager();

0 comments on commit cdb147d

Please sign in to comment.