Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move tests app #307

Merged
merged 3 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ jobs:
-
name: Prepare test application
run: |
(cd src/Bundle/test && bin/console doctrine:database:drop --force -n)
(cd src/Bundle/test && bin/console doctrine:database:create)
(cd src/Bundle/test && bin/console doctrine:schema:create)
(cd tests/Application && bin/console doctrine:database:drop --force -n)
(cd tests/Application && bin/console doctrine:database:create)
(cd tests/Application && bin/console doctrine:schema:create)

-
name: Run analysis
Expand All @@ -92,32 +92,32 @@ jobs:

-
name: Run lint container
run: (cd src/Bundle/test && bin/console lint:container)
run: (cd tests/Application && bin/console lint:container)

-
name: Run tests for grids with php config
if: matrix.symfony == '^5.3'
run: |
(cd src/Bundle/test && bin/console cache:clear --env=test_grids_with_php_config)
(cd tests/Application && bin/console cache:clear --env=test_grids_with_php_config)
composer test-php-config

-
name: Run tests with grids as services
run: |
(cd src/Bundle/test && bin/console cache:clear --env=test_grids_as_service)
(cd tests/Application && bin/console cache:clear --env=test_grids_as_service)
composer test-with-grids-as-service

-
name: Run tests with PostgresSQL
if: matrix.postgres != ''
run: |
(cd src/Bundle/test && bin/console cache:clear --env=test_with_postgres)
(cd src/Bundle/test && bin/console doctrine:database:create --env=test_with_postgres)
(cd src/Bundle/test && bin/console doctrine:schema:create --env=test_with_postgres)
(cd tests/Application && bin/console cache:clear --env=test_with_postgres)
(cd tests/Application && bin/console doctrine:database:create --env=test_with_postgres)
(cd tests/Application && bin/console doctrine:schema:create --env=test_with_postgres)
composer test-with-postgres

-
name: Run lint container without maker bundle
run: |
APP_ENV=test_without_maker composer remove --dev symfony/maker-bundle
(cd src/Bundle/test && bin/console lint:container --env=test_without_maker)
(cd tests/Application && bin/console lint:container --env=test_without_maker)
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@
"psr-4": {
"Sylius\\Bundle\\GridBundle\\spec\\": "src/Bundle/spec/",
"Sylius\\Component\\Grid\\spec\\": "src/Component/spec/",
"App\\": "src/Bundle/test/src/",
"App\\": "tests/Application/src/",
"AppBundle\\": "src/Bundle/test/src/AppBundle/",
"App\\Tests\\Tmp\\": "src/Bundle/test/tmp"
"App\\Tests\\Tmp\\": "tests/Application/tmp/"
}
},
"config": {
Expand All @@ -113,12 +113,12 @@
"scripts": {
"analyse": [
"@composer validate --strict",
"vendor/bin/ecs check src",
"vendor/bin/ecs check",
"vendor/bin/phpstan analyse --ansi -c phpstan.neon -l max src",
"vendor/bin/psalm"
],
"fix": [
"vendor/bin/ecs check src --fix"
"vendor/bin/ecs check --fix"
],
"test": [
"vendor/bin/phpspec run --ansi --no-interaction",
Expand Down
18 changes: 0 additions & 18 deletions easy-coding-standard.yml

This file was deleted.

27 changes: 15 additions & 12 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,28 @@
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Option;

return static function (ECSConfig $containerConfigurator): void {
$containerConfigurator->import('vendor/sylius-labs/coding-standard/ecs.php');
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
]);

$ecsConfig->import('vendor/sylius-labs/coding-standard/ecs.php');

$containerConfigurator
->services()
->set(HeaderCommentFixer::class)->call('configure', [[
'location' => 'after_open',
'header' =>
'This file is part of the Sylius package.
$ecsConfig->ruleWithConfiguration(HeaderCommentFixer::class, [
'location' => 'after_open',
'header' =>
'This file is part of the Sylius package.

(c) Paweł Jędrzejewski
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rafikooo you should update licences in technical libs as well, shouldn't you?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, Lukasz, it will be another PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lchrusciel, sure! 🚀


For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.',
]])
->set(NoSuperfluousPhpdocTagsFixer::class)->call('configure', [['allow_mixed' => true]])
;
]);

$ecsConfig->ruleWithConfiguration(NoSuperfluousPhpdocTagsFixer::class, ['allow_mixed' => true]);

$containerConfigurator->parameters()->set(Option::SKIP, [
$ecsConfig->skip([
InlineDocCommentDeclarationSniff::class . '.MissingVariable',
VisibilityRequiredFixer::class => ['*Spec.php'],
MethodArgumentSpaceFixer::class => ['*/BoardGameBlog/*'],
Expand Down
1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ parameters:
- %currentWorkingDirectory%/src/Bundle/Renderer/TwigGridRenderer.php
- %currentWorkingDirectory%/src/Bundle/Resources/*
- %currentWorkingDirectory%/src/Bundle/spec/*
- %currentWorkingDirectory%/src/Bundle/test/*
- %currentWorkingDirectory%/src/Bundle/Tests/*
- %currentWorkingDirectory%/src/Component/DataExtractor/PropertyAccessDataExtractor.php
- %currentWorkingDirectory%/src/Component/Definition/Filter.php
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<testsuites>
<testsuite name="SyliusGridBundle Test Suite">
<directory>./src/Bundle/test/</directory>
<directory>./tests/</directory>
<directory>./src/Bundle/Tests/</directory>
</testsuite>
</testsuites>
Expand Down
1 change: 0 additions & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<directory name="src/Bundle/Doctrine/PHPCRODM" />
<directory name="src/Bundle/Resources" />
<directory name="src/Bundle/spec" />
<directory name="src/Bundle/test" />
<directory name="src/Bundle/Tests" />
<directory name="src/Component/spec" />
<directory name="src/Component/vendor" />
Expand Down
2 changes: 1 addition & 1 deletion src/Bundle/Tests/Functional/Maker/MakerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static function cleanupTmpDir(): void

protected static function tempDir(): string
{
return __DIR__ . '/../../../test/tmp';
return dirname(__DIR__, 5) . '/tests/Application/tmp';
}

protected static function tempFile(string $path): string
Expand Down
File renamed without changes.
10 changes: 10 additions & 0 deletions tests/Application/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
###> symfony/framework-bundle ###
/.env.*.local
/.env.local
/.env.local.php
/public/bundles
/var/
/vendor/
###< symfony/framework-bundle ###

config/db.sql
4 changes: 2 additions & 2 deletions src/Bundle/test/bin/console → tests/Application/bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use Symfony\Component\Debug\Debug;

set_time_limit(0);

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

if (!class_exists(Application::class)) {
throw new RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
Expand All @@ -23,7 +23,7 @@ if ($input->hasParameterOption('--no-debug', true)) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
}

require dirname(__DIR__).'/config/bootstrap.php';
require dirname(__DIR__) . '/config/bootstrap.php';

if ($_SERVER['APP_DEBUG']) {
umask(0000);
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use Symfony\Component\Dotenv\Dotenv;

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

// Load cached env vars if the .env.local.php file exists
// Run "composer dump-env prod" to create it (requires symfony/flex >=1.2)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Symfony\Component\ErrorHandler\Debug;
use Symfony\Component\HttpFoundation\Request;

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

if (!class_exists(Application::class)) {
throw new RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
Expand Down
File renamed without changes.