Skip to content

Commit

Permalink
test: Fixed tests directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Mar 12, 2024
1 parent 261c583 commit ad895dc
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 5 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@
"RZ\\Roadiz\\UserBundle\\": "lib/RoadizUserBundle/src/",
"RZ\\Roadiz\\Utils\\": "lib/Models/src/Roadiz/Utils/",
"Themes\\": "themes/",
"Themes\\Rozier\\": "lib/Rozier/src/",
"tests\\mocks\\": "lib/EntityGenerator/tests/mocks/"
"Themes\\Rozier\\": "lib/Rozier/src/"
}
},
"autoload-dev": {
Expand Down
2 changes: 1 addition & 1 deletion lib/Models/.github/workflows/run-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Install Dependencies
run: composer install --no-scripts --no-ansi --no-interaction --no-progress
- name: Run PHPUnit tests
run: vendor/bin/phpunit -v --whitelist ./src --coverage-clover ./build/logs/clover.xml tests/
run: vendor/bin/phpunit -v --whitelist ./src --coverage-clover ./build/logs/clover.xml src/Test
- name: Run PHP Code Sniffer
run: vendor/bin/phpcs -p ./src
- name: Run PHPStan
Expand Down
5 changes: 5 additions & 0 deletions lib/RoadizCoreBundle/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 lib/RoadizCoreBundle/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 lib/RoadizCoreBundle/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();
6 changes: 5 additions & 1 deletion lib/RoadizTwoFactorBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@
"phpstan/phpstan-doctrine": "^1.3",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.5",
"symfony/stopwatch": "6.4.*"
"symfony/stopwatch": "6.4.*",
"roadiz/entity-generator": "2.3.x-dev",
"roadiz/doc-generator": "2.3.x-dev",
"roadiz/random": "2.3.x-dev",
"roadiz/jwt": "2.3.x-dev"
},
"config": {
"optimize-autoloader": true,
Expand Down
6 changes: 5 additions & 1 deletion lib/RoadizUserBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
"php-coveralls/php-coveralls": "^2.4",
"phpstan/phpstan": "^1.5.3",
"squizlabs/php_codesniffer": "^3.5",
"phpstan/phpstan-doctrine": "^1.3"
"phpstan/phpstan-doctrine": "^1.3",
"roadiz/entity-generator": "2.3.x-dev",
"roadiz/doc-generator": "2.3.x-dev",
"roadiz/random": "2.3.x-dev",
"roadiz/jwt": "2.3.x-dev"
},
"config": {
"optimize-autoloader": true,
Expand Down

0 comments on commit ad895dc

Please sign in to comment.