From 661f64e58b1c1cd4180b5fbfea20b07f9cd54557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Fr=C3=A9mont?= Date: Mon, 19 Jun 2023 17:00:43 +0200 Subject: [PATCH 1/3] Move tests application --- composer.json | 8 +++--- easy-coding-standard.yml | 18 ------------ ecs.php | 27 ++++++++++-------- phpstan.neon | 1 - phpunit.xml.dist | 2 +- psalm.xml | 1 - {src/Bundle/test => tests/Application}/.env | 0 tests/Application/.gitignore | 10 +++++++ .../test => tests/Application}/bin/console | 4 +-- .../test => tests/Application}/composer.json | 0 .../Application}/config/bootstrap.php | 2 +- .../Application}/config/bundles.php | 0 .../Application}/config/data/board_games.csv | 0 .../test => tests/Application}/config/db.sql | Bin .../config/doctrine/AdminUser.orm.yml | 0 .../config/doctrine/Author.orm.yml | 0 .../Application}/config/doctrine/Book.orm.yml | 0 .../config/doctrine/Nationality.orm.yml | 0 .../config/doctrine/Price.orm.yml | 0 .../config/packages/doctrine.yaml | 0 .../config/packages/fos_rest.yaml | 0 .../config/packages/framework.yaml | 0 .../Application}/config/packages/twig.yaml | 0 .../Application}/config/routes.yaml | 0 .../config/routes/sylius_resource.yaml | 0 .../Application}/config/services.yaml | 0 .../services_test_grids_as_service.yaml | 0 .../services_test_grids_with_php_config.yaml | 0 .../services_test_grids_with_yaml_config.yaml | 0 .../config/services_test_with_postgres.yaml | 0 .../Application}/config/sylius/grids.yaml | 0 .../config/sylius/grids/author.php | 0 ...ks_with_fetch_join_collection_disabled.php | 0 ...oks_with_fetch_join_collection_enabled.php | 0 ...books_with_use_output_walkers_disabled.php | 0 ..._books_with_use_output_walkers_enabled.php | 0 .../Application}/config/sylius/grids/book.php | 0 .../sylius/grids/book_by_amercian_authors.php | 0 .../sylius/grids/book_by_english_authors.php | 0 .../Application}/config/sylius/resources.yaml | 0 .../Application}/public/index.php | 2 +- .../Sylius/Grid/BoardGameGrid.php | 0 .../DataProvider/BoardGameGridProvider.php | 0 .../Sylius/Resource/BoardGameResource.php | 0 .../Application}/src/Driver/Foo.php | 0 .../Application}/src/Entity/AdminUser.php | 0 .../Application}/src/Entity/Author.php | 0 .../Application}/src/Entity/Book.php | 0 .../Application}/src/Entity/Nationality.php | 0 .../Application}/src/Entity/Price.php | 0 .../Application}/src/FieldTypes/FooType.php | 0 .../Application}/src/Filter/Foo.php | 0 .../src/Filter/NationalityFilter.php | 0 .../Application}/src/Grid/AuthorGrid.php | 0 ...thBooksWithFetchJoinCollectionDisabled.php | 0 ...ithBooksWithFetchJoinCollectionEnabled.php | 0 ...rWithBooksWithUseOutputWalkersDisabled.php | 0 ...orWithBooksWithUseOutputWalkersEnabled.php | 0 .../src/Grid/BookByAmericanAuthorsGrid.php | 0 .../src/Grid/BookByEnglishAuthorsGrid.php | 0 .../Application}/src/Grid/BookGrid.php | 0 .../Application}/src/Grid/BookmarkGrid.php | 0 .../src/Grid/Builder/NationalityFilter.php | 0 .../src/Grid/Type/NationalityFilterType.php | 0 .../test => tests/Application}/src/Kernel.php | 0 .../AuthorsWithBooksQueryBuilder.php | 0 .../QueryBuilder/EnglishBooksQueryBuilder.php | 0 .../src/Repository/BookRepository.php | 0 .../templates/crud/index.html.twig | 0 .../translations/messages.en.yaml | 0 70 files changed, 34 insertions(+), 41 deletions(-) delete mode 100644 easy-coding-standard.yml rename {src/Bundle/test => tests/Application}/.env (100%) create mode 100644 tests/Application/.gitignore rename {src/Bundle/test => tests/Application}/bin/console (89%) rename {src/Bundle/test => tests/Application}/composer.json (100%) rename {src/Bundle/test => tests/Application}/config/bootstrap.php (95%) rename {src/Bundle/test => tests/Application}/config/bundles.php (100%) rename {src/Bundle/test => tests/Application}/config/data/board_games.csv (100%) rename {src/Bundle/test => tests/Application}/config/db.sql (100%) rename {src/Bundle/test => tests/Application}/config/doctrine/AdminUser.orm.yml (100%) rename {src/Bundle/test => tests/Application}/config/doctrine/Author.orm.yml (100%) rename {src/Bundle/test => tests/Application}/config/doctrine/Book.orm.yml (100%) rename {src/Bundle/test => tests/Application}/config/doctrine/Nationality.orm.yml (100%) rename {src/Bundle/test => tests/Application}/config/doctrine/Price.orm.yml (100%) rename {src/Bundle/test => tests/Application}/config/packages/doctrine.yaml (100%) rename {src/Bundle/test => tests/Application}/config/packages/fos_rest.yaml (100%) rename {src/Bundle/test => tests/Application}/config/packages/framework.yaml (100%) rename {src/Bundle/test => tests/Application}/config/packages/twig.yaml (100%) rename {src/Bundle/test => tests/Application}/config/routes.yaml (100%) rename {src/Bundle/test => tests/Application}/config/routes/sylius_resource.yaml (100%) rename {src/Bundle/test => tests/Application}/config/services.yaml (100%) rename {src/Bundle/test => tests/Application}/config/services_test_grids_as_service.yaml (100%) rename {src/Bundle/test => tests/Application}/config/services_test_grids_with_php_config.yaml (100%) rename {src/Bundle/test => tests/Application}/config/services_test_grids_with_yaml_config.yaml (100%) rename {src/Bundle/test => tests/Application}/config/services_test_with_postgres.yaml (100%) rename {src/Bundle/test => tests/Application}/config/sylius/grids.yaml (100%) rename {src/Bundle/test => tests/Application}/config/sylius/grids/author.php (100%) rename {src/Bundle/test => tests/Application}/config/sylius/grids/author_with_books_with_fetch_join_collection_disabled.php (100%) rename {src/Bundle/test => tests/Application}/config/sylius/grids/author_with_books_with_fetch_join_collection_enabled.php (100%) rename {src/Bundle/test => tests/Application}/config/sylius/grids/author_with_books_with_use_output_walkers_disabled.php (100%) rename {src/Bundle/test => tests/Application}/config/sylius/grids/author_with_books_with_use_output_walkers_enabled.php (100%) rename {src/Bundle/test => tests/Application}/config/sylius/grids/book.php (100%) rename {src/Bundle/test => tests/Application}/config/sylius/grids/book_by_amercian_authors.php (100%) rename {src/Bundle/test => tests/Application}/config/sylius/grids/book_by_english_authors.php (100%) rename {src/Bundle/test => tests/Application}/config/sylius/resources.yaml (100%) rename {src/Bundle/test => tests/Application}/public/index.php (96%) rename {src/Bundle/test => tests/Application}/src/BoardGameBlog/Infrastructure/Sylius/Grid/BoardGameGrid.php (100%) rename {src/Bundle/test => tests/Application}/src/BoardGameBlog/Infrastructure/Sylius/Grid/DataProvider/BoardGameGridProvider.php (100%) rename {src/Bundle/test => tests/Application}/src/BoardGameBlog/Infrastructure/Sylius/Resource/BoardGameResource.php (100%) rename {src/Bundle/test => tests/Application}/src/Driver/Foo.php (100%) rename {src/Bundle/test => tests/Application}/src/Entity/AdminUser.php (100%) rename {src/Bundle/test => tests/Application}/src/Entity/Author.php (100%) rename {src/Bundle/test => tests/Application}/src/Entity/Book.php (100%) rename {src/Bundle/test => tests/Application}/src/Entity/Nationality.php (100%) rename {src/Bundle/test => tests/Application}/src/Entity/Price.php (100%) rename {src/Bundle/test => tests/Application}/src/FieldTypes/FooType.php (100%) rename {src/Bundle/test => tests/Application}/src/Filter/Foo.php (100%) rename {src/Bundle/test => tests/Application}/src/Filter/NationalityFilter.php (100%) rename {src/Bundle/test => tests/Application}/src/Grid/AuthorGrid.php (100%) rename {src/Bundle/test => tests/Application}/src/Grid/AuthorWithBooksWithFetchJoinCollectionDisabled.php (100%) rename {src/Bundle/test => tests/Application}/src/Grid/AuthorWithBooksWithFetchJoinCollectionEnabled.php (100%) rename {src/Bundle/test => tests/Application}/src/Grid/AuthorWithBooksWithUseOutputWalkersDisabled.php (100%) rename {src/Bundle/test => tests/Application}/src/Grid/AuthorWithBooksWithUseOutputWalkersEnabled.php (100%) rename {src/Bundle/test => tests/Application}/src/Grid/BookByAmericanAuthorsGrid.php (100%) rename {src/Bundle/test => tests/Application}/src/Grid/BookByEnglishAuthorsGrid.php (100%) rename {src/Bundle/test => tests/Application}/src/Grid/BookGrid.php (100%) rename {src/Bundle/test => tests/Application}/src/Grid/BookmarkGrid.php (100%) rename {src/Bundle/test => tests/Application}/src/Grid/Builder/NationalityFilter.php (100%) rename {src/Bundle/test => tests/Application}/src/Grid/Type/NationalityFilterType.php (100%) rename {src/Bundle/test => tests/Application}/src/Kernel.php (100%) rename {src/Bundle/test => tests/Application}/src/QueryBuilder/AuthorsWithBooksQueryBuilder.php (100%) rename {src/Bundle/test => tests/Application}/src/QueryBuilder/EnglishBooksQueryBuilder.php (100%) rename {src/Bundle/test => tests/Application}/src/Repository/BookRepository.php (100%) rename {src/Bundle/test => tests/Application}/templates/crud/index.html.twig (100%) rename {src/Bundle/test => tests/Application}/translations/messages.en.yaml (100%) diff --git a/composer.json b/composer.json index 3fe27cea..f8c9163c 100644 --- a/composer.json +++ b/composer.json @@ -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": { @@ -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", diff --git a/easy-coding-standard.yml b/easy-coding-standard.yml deleted file mode 100644 index 3698dad5..00000000 --- a/easy-coding-standard.yml +++ /dev/null @@ -1,18 +0,0 @@ -imports: - - { resource: 'vendor/sylius-labs/coding-standard/easy-coding-standard.yml' } - -services: - PhpCsFixer\Fixer\Comment\HeaderCommentFixer: - header: | - This file is part of the Sylius package. - - (c) Paweł Jędrzejewski - - For the full copyright and license information, please view the LICENSE - file that was distributed with this source code. - location: 'after_open' - -parameters: - exclude_files: - - 'src/Bundle/test/app/cache/*' - - 'src/Bundle/test/var/*' diff --git a/ecs.php b/ecs.php index 565f99f9..eefdcd55 100644 --- a/ecs.php +++ b/ecs.php @@ -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 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/*'], diff --git a/phpstan.neon b/phpstan.neon index 3004f8f7..c5809b08 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -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 diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3276cb33..7ba2b865 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -20,7 +20,7 @@ - ./src/Bundle/test/ + ./tests/ ./src/Bundle/Tests/ diff --git a/psalm.xml b/psalm.xml index 5a2ec56d..00d59428 100644 --- a/psalm.xml +++ b/psalm.xml @@ -12,7 +12,6 @@ - diff --git a/src/Bundle/test/.env b/tests/Application/.env similarity index 100% rename from src/Bundle/test/.env rename to tests/Application/.env diff --git a/tests/Application/.gitignore b/tests/Application/.gitignore new file mode 100644 index 00000000..eb824c83 --- /dev/null +++ b/tests/Application/.gitignore @@ -0,0 +1,10 @@ +###> symfony/framework-bundle ### +/.env.*.local +/.env.local +/.env.local.php +/public/bundles +/var/ +/vendor/ +###< symfony/framework-bundle ### + +config/db.sql diff --git a/src/Bundle/test/bin/console b/tests/Application/bin/console similarity index 89% rename from src/Bundle/test/bin/console rename to tests/Application/bin/console index 3b1b0a63..6a8d6eff 100755 --- a/src/Bundle/test/bin/console +++ b/tests/Application/bin/console @@ -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.'); @@ -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); diff --git a/src/Bundle/test/composer.json b/tests/Application/composer.json similarity index 100% rename from src/Bundle/test/composer.json rename to tests/Application/composer.json diff --git a/src/Bundle/test/config/bootstrap.php b/tests/Application/config/bootstrap.php similarity index 95% rename from src/Bundle/test/config/bootstrap.php rename to tests/Application/config/bootstrap.php index 2078f2e9..c8675f40 100644 --- a/src/Bundle/test/config/bootstrap.php +++ b/tests/Application/config/bootstrap.php @@ -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) diff --git a/src/Bundle/test/config/bundles.php b/tests/Application/config/bundles.php similarity index 100% rename from src/Bundle/test/config/bundles.php rename to tests/Application/config/bundles.php diff --git a/src/Bundle/test/config/data/board_games.csv b/tests/Application/config/data/board_games.csv similarity index 100% rename from src/Bundle/test/config/data/board_games.csv rename to tests/Application/config/data/board_games.csv diff --git a/src/Bundle/test/config/db.sql b/tests/Application/config/db.sql similarity index 100% rename from src/Bundle/test/config/db.sql rename to tests/Application/config/db.sql diff --git a/src/Bundle/test/config/doctrine/AdminUser.orm.yml b/tests/Application/config/doctrine/AdminUser.orm.yml similarity index 100% rename from src/Bundle/test/config/doctrine/AdminUser.orm.yml rename to tests/Application/config/doctrine/AdminUser.orm.yml diff --git a/src/Bundle/test/config/doctrine/Author.orm.yml b/tests/Application/config/doctrine/Author.orm.yml similarity index 100% rename from src/Bundle/test/config/doctrine/Author.orm.yml rename to tests/Application/config/doctrine/Author.orm.yml diff --git a/src/Bundle/test/config/doctrine/Book.orm.yml b/tests/Application/config/doctrine/Book.orm.yml similarity index 100% rename from src/Bundle/test/config/doctrine/Book.orm.yml rename to tests/Application/config/doctrine/Book.orm.yml diff --git a/src/Bundle/test/config/doctrine/Nationality.orm.yml b/tests/Application/config/doctrine/Nationality.orm.yml similarity index 100% rename from src/Bundle/test/config/doctrine/Nationality.orm.yml rename to tests/Application/config/doctrine/Nationality.orm.yml diff --git a/src/Bundle/test/config/doctrine/Price.orm.yml b/tests/Application/config/doctrine/Price.orm.yml similarity index 100% rename from src/Bundle/test/config/doctrine/Price.orm.yml rename to tests/Application/config/doctrine/Price.orm.yml diff --git a/src/Bundle/test/config/packages/doctrine.yaml b/tests/Application/config/packages/doctrine.yaml similarity index 100% rename from src/Bundle/test/config/packages/doctrine.yaml rename to tests/Application/config/packages/doctrine.yaml diff --git a/src/Bundle/test/config/packages/fos_rest.yaml b/tests/Application/config/packages/fos_rest.yaml similarity index 100% rename from src/Bundle/test/config/packages/fos_rest.yaml rename to tests/Application/config/packages/fos_rest.yaml diff --git a/src/Bundle/test/config/packages/framework.yaml b/tests/Application/config/packages/framework.yaml similarity index 100% rename from src/Bundle/test/config/packages/framework.yaml rename to tests/Application/config/packages/framework.yaml diff --git a/src/Bundle/test/config/packages/twig.yaml b/tests/Application/config/packages/twig.yaml similarity index 100% rename from src/Bundle/test/config/packages/twig.yaml rename to tests/Application/config/packages/twig.yaml diff --git a/src/Bundle/test/config/routes.yaml b/tests/Application/config/routes.yaml similarity index 100% rename from src/Bundle/test/config/routes.yaml rename to tests/Application/config/routes.yaml diff --git a/src/Bundle/test/config/routes/sylius_resource.yaml b/tests/Application/config/routes/sylius_resource.yaml similarity index 100% rename from src/Bundle/test/config/routes/sylius_resource.yaml rename to tests/Application/config/routes/sylius_resource.yaml diff --git a/src/Bundle/test/config/services.yaml b/tests/Application/config/services.yaml similarity index 100% rename from src/Bundle/test/config/services.yaml rename to tests/Application/config/services.yaml diff --git a/src/Bundle/test/config/services_test_grids_as_service.yaml b/tests/Application/config/services_test_grids_as_service.yaml similarity index 100% rename from src/Bundle/test/config/services_test_grids_as_service.yaml rename to tests/Application/config/services_test_grids_as_service.yaml diff --git a/src/Bundle/test/config/services_test_grids_with_php_config.yaml b/tests/Application/config/services_test_grids_with_php_config.yaml similarity index 100% rename from src/Bundle/test/config/services_test_grids_with_php_config.yaml rename to tests/Application/config/services_test_grids_with_php_config.yaml diff --git a/src/Bundle/test/config/services_test_grids_with_yaml_config.yaml b/tests/Application/config/services_test_grids_with_yaml_config.yaml similarity index 100% rename from src/Bundle/test/config/services_test_grids_with_yaml_config.yaml rename to tests/Application/config/services_test_grids_with_yaml_config.yaml diff --git a/src/Bundle/test/config/services_test_with_postgres.yaml b/tests/Application/config/services_test_with_postgres.yaml similarity index 100% rename from src/Bundle/test/config/services_test_with_postgres.yaml rename to tests/Application/config/services_test_with_postgres.yaml diff --git a/src/Bundle/test/config/sylius/grids.yaml b/tests/Application/config/sylius/grids.yaml similarity index 100% rename from src/Bundle/test/config/sylius/grids.yaml rename to tests/Application/config/sylius/grids.yaml diff --git a/src/Bundle/test/config/sylius/grids/author.php b/tests/Application/config/sylius/grids/author.php similarity index 100% rename from src/Bundle/test/config/sylius/grids/author.php rename to tests/Application/config/sylius/grids/author.php diff --git a/src/Bundle/test/config/sylius/grids/author_with_books_with_fetch_join_collection_disabled.php b/tests/Application/config/sylius/grids/author_with_books_with_fetch_join_collection_disabled.php similarity index 100% rename from src/Bundle/test/config/sylius/grids/author_with_books_with_fetch_join_collection_disabled.php rename to tests/Application/config/sylius/grids/author_with_books_with_fetch_join_collection_disabled.php diff --git a/src/Bundle/test/config/sylius/grids/author_with_books_with_fetch_join_collection_enabled.php b/tests/Application/config/sylius/grids/author_with_books_with_fetch_join_collection_enabled.php similarity index 100% rename from src/Bundle/test/config/sylius/grids/author_with_books_with_fetch_join_collection_enabled.php rename to tests/Application/config/sylius/grids/author_with_books_with_fetch_join_collection_enabled.php diff --git a/src/Bundle/test/config/sylius/grids/author_with_books_with_use_output_walkers_disabled.php b/tests/Application/config/sylius/grids/author_with_books_with_use_output_walkers_disabled.php similarity index 100% rename from src/Bundle/test/config/sylius/grids/author_with_books_with_use_output_walkers_disabled.php rename to tests/Application/config/sylius/grids/author_with_books_with_use_output_walkers_disabled.php diff --git a/src/Bundle/test/config/sylius/grids/author_with_books_with_use_output_walkers_enabled.php b/tests/Application/config/sylius/grids/author_with_books_with_use_output_walkers_enabled.php similarity index 100% rename from src/Bundle/test/config/sylius/grids/author_with_books_with_use_output_walkers_enabled.php rename to tests/Application/config/sylius/grids/author_with_books_with_use_output_walkers_enabled.php diff --git a/src/Bundle/test/config/sylius/grids/book.php b/tests/Application/config/sylius/grids/book.php similarity index 100% rename from src/Bundle/test/config/sylius/grids/book.php rename to tests/Application/config/sylius/grids/book.php diff --git a/src/Bundle/test/config/sylius/grids/book_by_amercian_authors.php b/tests/Application/config/sylius/grids/book_by_amercian_authors.php similarity index 100% rename from src/Bundle/test/config/sylius/grids/book_by_amercian_authors.php rename to tests/Application/config/sylius/grids/book_by_amercian_authors.php diff --git a/src/Bundle/test/config/sylius/grids/book_by_english_authors.php b/tests/Application/config/sylius/grids/book_by_english_authors.php similarity index 100% rename from src/Bundle/test/config/sylius/grids/book_by_english_authors.php rename to tests/Application/config/sylius/grids/book_by_english_authors.php diff --git a/src/Bundle/test/config/sylius/resources.yaml b/tests/Application/config/sylius/resources.yaml similarity index 100% rename from src/Bundle/test/config/sylius/resources.yaml rename to tests/Application/config/sylius/resources.yaml diff --git a/src/Bundle/test/public/index.php b/tests/Application/public/index.php similarity index 96% rename from src/Bundle/test/public/index.php rename to tests/Application/public/index.php index bb146611..a14c36ae 100644 --- a/src/Bundle/test/public/index.php +++ b/tests/Application/public/index.php @@ -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.'); diff --git a/src/Bundle/test/src/BoardGameBlog/Infrastructure/Sylius/Grid/BoardGameGrid.php b/tests/Application/src/BoardGameBlog/Infrastructure/Sylius/Grid/BoardGameGrid.php similarity index 100% rename from src/Bundle/test/src/BoardGameBlog/Infrastructure/Sylius/Grid/BoardGameGrid.php rename to tests/Application/src/BoardGameBlog/Infrastructure/Sylius/Grid/BoardGameGrid.php diff --git a/src/Bundle/test/src/BoardGameBlog/Infrastructure/Sylius/Grid/DataProvider/BoardGameGridProvider.php b/tests/Application/src/BoardGameBlog/Infrastructure/Sylius/Grid/DataProvider/BoardGameGridProvider.php similarity index 100% rename from src/Bundle/test/src/BoardGameBlog/Infrastructure/Sylius/Grid/DataProvider/BoardGameGridProvider.php rename to tests/Application/src/BoardGameBlog/Infrastructure/Sylius/Grid/DataProvider/BoardGameGridProvider.php diff --git a/src/Bundle/test/src/BoardGameBlog/Infrastructure/Sylius/Resource/BoardGameResource.php b/tests/Application/src/BoardGameBlog/Infrastructure/Sylius/Resource/BoardGameResource.php similarity index 100% rename from src/Bundle/test/src/BoardGameBlog/Infrastructure/Sylius/Resource/BoardGameResource.php rename to tests/Application/src/BoardGameBlog/Infrastructure/Sylius/Resource/BoardGameResource.php diff --git a/src/Bundle/test/src/Driver/Foo.php b/tests/Application/src/Driver/Foo.php similarity index 100% rename from src/Bundle/test/src/Driver/Foo.php rename to tests/Application/src/Driver/Foo.php diff --git a/src/Bundle/test/src/Entity/AdminUser.php b/tests/Application/src/Entity/AdminUser.php similarity index 100% rename from src/Bundle/test/src/Entity/AdminUser.php rename to tests/Application/src/Entity/AdminUser.php diff --git a/src/Bundle/test/src/Entity/Author.php b/tests/Application/src/Entity/Author.php similarity index 100% rename from src/Bundle/test/src/Entity/Author.php rename to tests/Application/src/Entity/Author.php diff --git a/src/Bundle/test/src/Entity/Book.php b/tests/Application/src/Entity/Book.php similarity index 100% rename from src/Bundle/test/src/Entity/Book.php rename to tests/Application/src/Entity/Book.php diff --git a/src/Bundle/test/src/Entity/Nationality.php b/tests/Application/src/Entity/Nationality.php similarity index 100% rename from src/Bundle/test/src/Entity/Nationality.php rename to tests/Application/src/Entity/Nationality.php diff --git a/src/Bundle/test/src/Entity/Price.php b/tests/Application/src/Entity/Price.php similarity index 100% rename from src/Bundle/test/src/Entity/Price.php rename to tests/Application/src/Entity/Price.php diff --git a/src/Bundle/test/src/FieldTypes/FooType.php b/tests/Application/src/FieldTypes/FooType.php similarity index 100% rename from src/Bundle/test/src/FieldTypes/FooType.php rename to tests/Application/src/FieldTypes/FooType.php diff --git a/src/Bundle/test/src/Filter/Foo.php b/tests/Application/src/Filter/Foo.php similarity index 100% rename from src/Bundle/test/src/Filter/Foo.php rename to tests/Application/src/Filter/Foo.php diff --git a/src/Bundle/test/src/Filter/NationalityFilter.php b/tests/Application/src/Filter/NationalityFilter.php similarity index 100% rename from src/Bundle/test/src/Filter/NationalityFilter.php rename to tests/Application/src/Filter/NationalityFilter.php diff --git a/src/Bundle/test/src/Grid/AuthorGrid.php b/tests/Application/src/Grid/AuthorGrid.php similarity index 100% rename from src/Bundle/test/src/Grid/AuthorGrid.php rename to tests/Application/src/Grid/AuthorGrid.php diff --git a/src/Bundle/test/src/Grid/AuthorWithBooksWithFetchJoinCollectionDisabled.php b/tests/Application/src/Grid/AuthorWithBooksWithFetchJoinCollectionDisabled.php similarity index 100% rename from src/Bundle/test/src/Grid/AuthorWithBooksWithFetchJoinCollectionDisabled.php rename to tests/Application/src/Grid/AuthorWithBooksWithFetchJoinCollectionDisabled.php diff --git a/src/Bundle/test/src/Grid/AuthorWithBooksWithFetchJoinCollectionEnabled.php b/tests/Application/src/Grid/AuthorWithBooksWithFetchJoinCollectionEnabled.php similarity index 100% rename from src/Bundle/test/src/Grid/AuthorWithBooksWithFetchJoinCollectionEnabled.php rename to tests/Application/src/Grid/AuthorWithBooksWithFetchJoinCollectionEnabled.php diff --git a/src/Bundle/test/src/Grid/AuthorWithBooksWithUseOutputWalkersDisabled.php b/tests/Application/src/Grid/AuthorWithBooksWithUseOutputWalkersDisabled.php similarity index 100% rename from src/Bundle/test/src/Grid/AuthorWithBooksWithUseOutputWalkersDisabled.php rename to tests/Application/src/Grid/AuthorWithBooksWithUseOutputWalkersDisabled.php diff --git a/src/Bundle/test/src/Grid/AuthorWithBooksWithUseOutputWalkersEnabled.php b/tests/Application/src/Grid/AuthorWithBooksWithUseOutputWalkersEnabled.php similarity index 100% rename from src/Bundle/test/src/Grid/AuthorWithBooksWithUseOutputWalkersEnabled.php rename to tests/Application/src/Grid/AuthorWithBooksWithUseOutputWalkersEnabled.php diff --git a/src/Bundle/test/src/Grid/BookByAmericanAuthorsGrid.php b/tests/Application/src/Grid/BookByAmericanAuthorsGrid.php similarity index 100% rename from src/Bundle/test/src/Grid/BookByAmericanAuthorsGrid.php rename to tests/Application/src/Grid/BookByAmericanAuthorsGrid.php diff --git a/src/Bundle/test/src/Grid/BookByEnglishAuthorsGrid.php b/tests/Application/src/Grid/BookByEnglishAuthorsGrid.php similarity index 100% rename from src/Bundle/test/src/Grid/BookByEnglishAuthorsGrid.php rename to tests/Application/src/Grid/BookByEnglishAuthorsGrid.php diff --git a/src/Bundle/test/src/Grid/BookGrid.php b/tests/Application/src/Grid/BookGrid.php similarity index 100% rename from src/Bundle/test/src/Grid/BookGrid.php rename to tests/Application/src/Grid/BookGrid.php diff --git a/src/Bundle/test/src/Grid/BookmarkGrid.php b/tests/Application/src/Grid/BookmarkGrid.php similarity index 100% rename from src/Bundle/test/src/Grid/BookmarkGrid.php rename to tests/Application/src/Grid/BookmarkGrid.php diff --git a/src/Bundle/test/src/Grid/Builder/NationalityFilter.php b/tests/Application/src/Grid/Builder/NationalityFilter.php similarity index 100% rename from src/Bundle/test/src/Grid/Builder/NationalityFilter.php rename to tests/Application/src/Grid/Builder/NationalityFilter.php diff --git a/src/Bundle/test/src/Grid/Type/NationalityFilterType.php b/tests/Application/src/Grid/Type/NationalityFilterType.php similarity index 100% rename from src/Bundle/test/src/Grid/Type/NationalityFilterType.php rename to tests/Application/src/Grid/Type/NationalityFilterType.php diff --git a/src/Bundle/test/src/Kernel.php b/tests/Application/src/Kernel.php similarity index 100% rename from src/Bundle/test/src/Kernel.php rename to tests/Application/src/Kernel.php diff --git a/src/Bundle/test/src/QueryBuilder/AuthorsWithBooksQueryBuilder.php b/tests/Application/src/QueryBuilder/AuthorsWithBooksQueryBuilder.php similarity index 100% rename from src/Bundle/test/src/QueryBuilder/AuthorsWithBooksQueryBuilder.php rename to tests/Application/src/QueryBuilder/AuthorsWithBooksQueryBuilder.php diff --git a/src/Bundle/test/src/QueryBuilder/EnglishBooksQueryBuilder.php b/tests/Application/src/QueryBuilder/EnglishBooksQueryBuilder.php similarity index 100% rename from src/Bundle/test/src/QueryBuilder/EnglishBooksQueryBuilder.php rename to tests/Application/src/QueryBuilder/EnglishBooksQueryBuilder.php diff --git a/src/Bundle/test/src/Repository/BookRepository.php b/tests/Application/src/Repository/BookRepository.php similarity index 100% rename from src/Bundle/test/src/Repository/BookRepository.php rename to tests/Application/src/Repository/BookRepository.php diff --git a/src/Bundle/test/templates/crud/index.html.twig b/tests/Application/templates/crud/index.html.twig similarity index 100% rename from src/Bundle/test/templates/crud/index.html.twig rename to tests/Application/templates/crud/index.html.twig diff --git a/src/Bundle/test/translations/messages.en.yaml b/tests/Application/translations/messages.en.yaml similarity index 100% rename from src/Bundle/test/translations/messages.en.yaml rename to tests/Application/translations/messages.en.yaml From 47217f5e8902bfdbdf9a0618cef60d22ec0463a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Fr=C3=A9mont?= Date: Mon, 19 Jun 2023 17:03:59 +0200 Subject: [PATCH 2/3] Fix tests application directory in Github actions --- .github/workflows/build.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e9d42c1b..86761bdf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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) From 8fe8690a85681dfaadfaa77f32ef79757dd39282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Fr=C3=A9mont?= Date: Mon, 19 Jun 2023 17:07:01 +0200 Subject: [PATCH 3/3] Fix making grids --- src/Bundle/Tests/Functional/Maker/MakerTestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/Tests/Functional/Maker/MakerTestCase.php b/src/Bundle/Tests/Functional/Maker/MakerTestCase.php index 2bbf52fc..fa1e3942 100644 --- a/src/Bundle/Tests/Functional/Maker/MakerTestCase.php +++ b/src/Bundle/Tests/Functional/Maker/MakerTestCase.php @@ -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