From bb5343c32fbe218e092639f076257f65122ca9a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Kukli=C5=84ski?= Date: Tue, 8 Oct 2024 20:40:33 +0200 Subject: [PATCH] Fix issue with loading fixture images on standalone project --- src/DependencyInjection/SyliusCmsExtension.php | 1 + src/Resources/config/fixtures/1_collection.yaml | 3 --- src/Resources/config/fixtures/1_media.yaml | 2 +- src/Resources/config/fixtures/1_template.yaml | 3 --- src/Resources/config/fixtures/2_block.yaml | 3 --- src/Resources/config/fixtures/2_page.yaml | 3 --- .../config/fixtures/images}/black_friday_banner.png | Bin .../config/fixtures/images}/blog_banner.png | Bin .../images}/blog_post_1_content_image_1.png | Bin .../images}/blog_post_1_content_image_2.png | Bin .../fixtures/images}/blog_post_1_header_banner.png | Bin .../fixtures/images}/blog_post_1_teaser_image.png | Bin .../images}/blog_post_2_content_image_1.png | Bin .../images}/blog_post_2_content_image_2.png | Bin .../fixtures/images}/blog_post_2_header_banner.png | Bin .../fixtures/images}/blog_post_2_teaser_image.png | Bin .../images}/blog_post_3_content_image_1.png | Bin .../images}/blog_post_3_content_image_2.png | Bin .../fixtures/images}/blog_post_3_header_banner.png | Bin .../fixtures/images}/blog_post_3_teaser_image.png | Bin .../config/fixtures/images}/homepage_banner_1.png | Bin .../config/fixtures/images}/homepage_banner_2.png | Bin .../config/fixtures/images}/homepage_banner_3.png | Bin .../fixtures/images}/specified_products_banner.png | Bin 24 files changed, 2 insertions(+), 13 deletions(-) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/black_friday_banner.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/blog_banner.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/blog_post_1_content_image_1.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/blog_post_1_content_image_2.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/blog_post_1_header_banner.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/blog_post_1_teaser_image.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/blog_post_2_content_image_1.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/blog_post_2_content_image_2.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/blog_post_2_header_banner.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/blog_post_2_teaser_image.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/blog_post_3_content_image_1.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/blog_post_3_content_image_2.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/blog_post_3_header_banner.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/blog_post_3_teaser_image.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/homepage_banner_1.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/homepage_banner_2.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/homepage_banner_3.png (100%) rename {tests/Application/Resources/fixtures => src/Resources/config/fixtures/images}/specified_products_banner.png (100%) diff --git a/src/DependencyInjection/SyliusCmsExtension.php b/src/DependencyInjection/SyliusCmsExtension.php index 19545c16..983f50e8 100755 --- a/src/DependencyInjection/SyliusCmsExtension.php +++ b/src/DependencyInjection/SyliusCmsExtension.php @@ -26,6 +26,7 @@ public function load(array $configs, ContainerBuilder $container): void public function prepend(ContainerBuilder $container): void { $config = $this->getCurrentConfiguration($container); + $container->setParameter('sylius_cms.fixtures_dir', __DIR__.'/../Resources/config/fixtures'); $this->registerResources('sylius_cms', 'doctrine/orm', $config['resources'], $container); diff --git a/src/Resources/config/fixtures/1_collection.yaml b/src/Resources/config/fixtures/1_collection.yaml index 94f1ab08..da2edc95 100644 --- a/src/Resources/config/fixtures/1_collection.yaml +++ b/src/Resources/config/fixtures/1_collection.yaml @@ -1,6 +1,3 @@ -parameters: - fixtures_dir: "%kernel.project_dir%/Resources/fixtures" - sylius_fixtures: suites: default: diff --git a/src/Resources/config/fixtures/1_media.yaml b/src/Resources/config/fixtures/1_media.yaml index 74f4f3d6..194034e5 100644 --- a/src/Resources/config/fixtures/1_media.yaml +++ b/src/Resources/config/fixtures/1_media.yaml @@ -1,5 +1,5 @@ parameters: - fixtures_dir: "%kernel.project_dir%/Resources/fixtures" + fixtures_dir: "%sylius_cms.fixtures_dir%/images" sylius_fixtures: suites: diff --git a/src/Resources/config/fixtures/1_template.yaml b/src/Resources/config/fixtures/1_template.yaml index 08bc5819..28bb08f5 100644 --- a/src/Resources/config/fixtures/1_template.yaml +++ b/src/Resources/config/fixtures/1_template.yaml @@ -1,6 +1,3 @@ -parameters: - fixtures_dir: "%kernel.project_dir%/Resources/fixtures" - sylius_fixtures: suites: default: diff --git a/src/Resources/config/fixtures/2_block.yaml b/src/Resources/config/fixtures/2_block.yaml index 69b1fdf6..f44e860c 100644 --- a/src/Resources/config/fixtures/2_block.yaml +++ b/src/Resources/config/fixtures/2_block.yaml @@ -1,6 +1,3 @@ -parameters: - fixtures_dir: "%kernel.project_dir%/Resources/fixtures" - sylius_fixtures: suites: default: diff --git a/src/Resources/config/fixtures/2_page.yaml b/src/Resources/config/fixtures/2_page.yaml index a2e5038e..c7fc88cb 100644 --- a/src/Resources/config/fixtures/2_page.yaml +++ b/src/Resources/config/fixtures/2_page.yaml @@ -1,6 +1,3 @@ -parameters: - fixtures_dir: "%kernel.project_dir%/Resources/fixtures" - sylius_fixtures: suites: default: diff --git a/tests/Application/Resources/fixtures/black_friday_banner.png b/src/Resources/config/fixtures/images/black_friday_banner.png similarity index 100% rename from tests/Application/Resources/fixtures/black_friday_banner.png rename to src/Resources/config/fixtures/images/black_friday_banner.png diff --git a/tests/Application/Resources/fixtures/blog_banner.png b/src/Resources/config/fixtures/images/blog_banner.png similarity index 100% rename from tests/Application/Resources/fixtures/blog_banner.png rename to src/Resources/config/fixtures/images/blog_banner.png diff --git a/tests/Application/Resources/fixtures/blog_post_1_content_image_1.png b/src/Resources/config/fixtures/images/blog_post_1_content_image_1.png similarity index 100% rename from tests/Application/Resources/fixtures/blog_post_1_content_image_1.png rename to src/Resources/config/fixtures/images/blog_post_1_content_image_1.png diff --git a/tests/Application/Resources/fixtures/blog_post_1_content_image_2.png b/src/Resources/config/fixtures/images/blog_post_1_content_image_2.png similarity index 100% rename from tests/Application/Resources/fixtures/blog_post_1_content_image_2.png rename to src/Resources/config/fixtures/images/blog_post_1_content_image_2.png diff --git a/tests/Application/Resources/fixtures/blog_post_1_header_banner.png b/src/Resources/config/fixtures/images/blog_post_1_header_banner.png similarity index 100% rename from tests/Application/Resources/fixtures/blog_post_1_header_banner.png rename to src/Resources/config/fixtures/images/blog_post_1_header_banner.png diff --git a/tests/Application/Resources/fixtures/blog_post_1_teaser_image.png b/src/Resources/config/fixtures/images/blog_post_1_teaser_image.png similarity index 100% rename from tests/Application/Resources/fixtures/blog_post_1_teaser_image.png rename to src/Resources/config/fixtures/images/blog_post_1_teaser_image.png diff --git a/tests/Application/Resources/fixtures/blog_post_2_content_image_1.png b/src/Resources/config/fixtures/images/blog_post_2_content_image_1.png similarity index 100% rename from tests/Application/Resources/fixtures/blog_post_2_content_image_1.png rename to src/Resources/config/fixtures/images/blog_post_2_content_image_1.png diff --git a/tests/Application/Resources/fixtures/blog_post_2_content_image_2.png b/src/Resources/config/fixtures/images/blog_post_2_content_image_2.png similarity index 100% rename from tests/Application/Resources/fixtures/blog_post_2_content_image_2.png rename to src/Resources/config/fixtures/images/blog_post_2_content_image_2.png diff --git a/tests/Application/Resources/fixtures/blog_post_2_header_banner.png b/src/Resources/config/fixtures/images/blog_post_2_header_banner.png similarity index 100% rename from tests/Application/Resources/fixtures/blog_post_2_header_banner.png rename to src/Resources/config/fixtures/images/blog_post_2_header_banner.png diff --git a/tests/Application/Resources/fixtures/blog_post_2_teaser_image.png b/src/Resources/config/fixtures/images/blog_post_2_teaser_image.png similarity index 100% rename from tests/Application/Resources/fixtures/blog_post_2_teaser_image.png rename to src/Resources/config/fixtures/images/blog_post_2_teaser_image.png diff --git a/tests/Application/Resources/fixtures/blog_post_3_content_image_1.png b/src/Resources/config/fixtures/images/blog_post_3_content_image_1.png similarity index 100% rename from tests/Application/Resources/fixtures/blog_post_3_content_image_1.png rename to src/Resources/config/fixtures/images/blog_post_3_content_image_1.png diff --git a/tests/Application/Resources/fixtures/blog_post_3_content_image_2.png b/src/Resources/config/fixtures/images/blog_post_3_content_image_2.png similarity index 100% rename from tests/Application/Resources/fixtures/blog_post_3_content_image_2.png rename to src/Resources/config/fixtures/images/blog_post_3_content_image_2.png diff --git a/tests/Application/Resources/fixtures/blog_post_3_header_banner.png b/src/Resources/config/fixtures/images/blog_post_3_header_banner.png similarity index 100% rename from tests/Application/Resources/fixtures/blog_post_3_header_banner.png rename to src/Resources/config/fixtures/images/blog_post_3_header_banner.png diff --git a/tests/Application/Resources/fixtures/blog_post_3_teaser_image.png b/src/Resources/config/fixtures/images/blog_post_3_teaser_image.png similarity index 100% rename from tests/Application/Resources/fixtures/blog_post_3_teaser_image.png rename to src/Resources/config/fixtures/images/blog_post_3_teaser_image.png diff --git a/tests/Application/Resources/fixtures/homepage_banner_1.png b/src/Resources/config/fixtures/images/homepage_banner_1.png similarity index 100% rename from tests/Application/Resources/fixtures/homepage_banner_1.png rename to src/Resources/config/fixtures/images/homepage_banner_1.png diff --git a/tests/Application/Resources/fixtures/homepage_banner_2.png b/src/Resources/config/fixtures/images/homepage_banner_2.png similarity index 100% rename from tests/Application/Resources/fixtures/homepage_banner_2.png rename to src/Resources/config/fixtures/images/homepage_banner_2.png diff --git a/tests/Application/Resources/fixtures/homepage_banner_3.png b/src/Resources/config/fixtures/images/homepage_banner_3.png similarity index 100% rename from tests/Application/Resources/fixtures/homepage_banner_3.png rename to src/Resources/config/fixtures/images/homepage_banner_3.png diff --git a/tests/Application/Resources/fixtures/specified_products_banner.png b/src/Resources/config/fixtures/images/specified_products_banner.png similarity index 100% rename from tests/Application/Resources/fixtures/specified_products_banner.png rename to src/Resources/config/fixtures/images/specified_products_banner.png