diff --git a/spec/Entity/CollectionTranslationSpec.php b/spec/Entity/CollectionTranslationSpec.php deleted file mode 100755 index ff6d3af63..000000000 --- a/spec/Entity/CollectionTranslationSpec.php +++ /dev/null @@ -1,42 +0,0 @@ -shouldHaveType(CollectionTranslation::class); - } - - public function it_is_a_resource() - { - $this->shouldHaveType(ResourceInterface::class); - } - - public function it_implements_frequently_asked_question_translation_interface() - { - $this->shouldHaveType(CollectionTranslationInterface::class); - $this->shouldHaveType(TranslationInterface::class); - } - - public function it_allows_access_via_properties() - { - $this->setName('Blog'); - $this->getName()->shouldReturn('Blog'); - } -} diff --git a/src/Resources/config/config.yml b/src/Resources/config/config.yml index 3844ca8f8..ee2c137ea 100755 --- a/src/Resources/config/config.yml +++ b/src/Resources/config/config.yml @@ -15,7 +15,6 @@ parameters: bitbag_sylius_cms_plugin.form.type.frequently_asked_question.validation_groups: "%bitbag_validation_group%" bitbag_sylius_cms_plugin.form.type.translation.frequently_asked_question.validation_groups: "%bitbag_validation_group%" bitbag_sylius_cms_plugin.form.type.collection.validation_groups: "%bitbag_validation_group%" - bitbag_sylius_cms_plugin.form.type.translation.collection.validation_groups: "%bitbag_validation_group%" bitbag_sylius_cms_plugin.form.type.translation.media.validation_groups: "%bitbag_validation_group%" bitbag_sylius_cms_plugin.form.type.media.validation_groups: "%bitbag_validation_group%" bitbag_sylius_cms_plugin.uploader.filesystem: bitbag_sylius_cms_plugin_media diff --git a/src/Resources/config/serialization/Block.xml b/src/Resources/config/serialization/Block.xml index e4109e3fb..7549db77b 100644 --- a/src/Resources/config/serialization/Block.xml +++ b/src/Resources/config/serialization/Block.xml @@ -25,9 +25,6 @@ shop:cms:read - - shop:cms:read - shop:cms:read diff --git a/tests/Functional/Api/CollectionTest.php b/tests/Functional/Api/CollectionTest.php index c9d9a67ec..8b2acab53 100644 --- a/tests/Functional/Api/CollectionTest.php +++ b/tests/Functional/Api/CollectionTest.php @@ -28,7 +28,7 @@ public function setUp(): void public function test_collection_response(): void { /** @var CollectionInterface $collection */ - $collection = $this->getRepository()->findOneByCode('collection1-code', 'en_US'); + $collection = $this->getRepository()->findOneByCode('collection1-code'); $this->client->request('GET', '/api/v2/shop/cms-plugin/collections/' . $collection->getId(), [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); diff --git a/tests/Functional/DataFixtures/ORM/Api/CollectionTest/collection.yml b/tests/Functional/DataFixtures/ORM/Api/CollectionTest/collection.yml index 14db5e793..cc87962bf 100644 --- a/tests/Functional/DataFixtures/ORM/Api/CollectionTest/collection.yml +++ b/tests/Functional/DataFixtures/ORM/Api/CollectionTest/collection.yml @@ -20,13 +20,10 @@ Sylius\Component\Core\Model\Channel: BitBag\SyliusCmsPlugin\Entity\Collection: collection1: code: 'collection1-code' - translations: - - '@collection1_translation' + name: 'collection1-name' collection2: code: 'collection2-code' - translations: - - '@collection2_translation' + name: 'collection2-name' collection3: code: 'collection3-code' - translations: - - '@collection3_translation' + name: 'collection3-name' diff --git a/tests/Integration/DataFixtures/ORM/CollectionRepositoryTest/test_it_finds_collection_by_code.yml b/tests/Integration/DataFixtures/ORM/CollectionRepositoryTest/test_it_finds_collection_by_code.yml index 14db5e793..110a74f72 100644 --- a/tests/Integration/DataFixtures/ORM/CollectionRepositoryTest/test_it_finds_collection_by_code.yml +++ b/tests/Integration/DataFixtures/ORM/CollectionRepositoryTest/test_it_finds_collection_by_code.yml @@ -20,13 +20,7 @@ Sylius\Component\Core\Model\Channel: BitBag\SyliusCmsPlugin\Entity\Collection: collection1: code: 'collection1-code' - translations: - - '@collection1_translation' collection2: code: 'collection2-code' - translations: - - '@collection2_translation' collection3: code: 'collection3-code' - translations: - - '@collection3_translation' diff --git a/tests/Integration/DataFixtures/ORM/CollectionRepositoryTest/test_it_finds_collection_by_codes_and_locale.yml b/tests/Integration/DataFixtures/ORM/CollectionRepositoryTest/test_it_finds_collection_by_codes_and_locale.yml index 14db5e793..110a74f72 100644 --- a/tests/Integration/DataFixtures/ORM/CollectionRepositoryTest/test_it_finds_collection_by_codes_and_locale.yml +++ b/tests/Integration/DataFixtures/ORM/CollectionRepositoryTest/test_it_finds_collection_by_codes_and_locale.yml @@ -20,13 +20,7 @@ Sylius\Component\Core\Model\Channel: BitBag\SyliusCmsPlugin\Entity\Collection: collection1: code: 'collection1-code' - translations: - - '@collection1_translation' collection2: code: 'collection2-code' - translations: - - '@collection2_translation' collection3: code: 'collection3-code' - translations: - - '@collection3_translation' diff --git a/tests/Integration/DataFixtures/ORM/CollectionRepositoryTest/test_it_finds_collection_by_name.yml b/tests/Integration/DataFixtures/ORM/CollectionRepositoryTest/test_it_finds_collection_by_name.yml index 14db5e793..cc87962bf 100644 --- a/tests/Integration/DataFixtures/ORM/CollectionRepositoryTest/test_it_finds_collection_by_name.yml +++ b/tests/Integration/DataFixtures/ORM/CollectionRepositoryTest/test_it_finds_collection_by_name.yml @@ -20,13 +20,10 @@ Sylius\Component\Core\Model\Channel: BitBag\SyliusCmsPlugin\Entity\Collection: collection1: code: 'collection1-code' - translations: - - '@collection1_translation' + name: 'collection1-name' collection2: code: 'collection2-code' - translations: - - '@collection2_translation' + name: 'collection2-name' collection3: code: 'collection3-code' - translations: - - '@collection3_translation' + name: 'collection3-name' diff --git a/tests/Integration/Repository/CollectionRepositoryTest.php b/tests/Integration/Repository/CollectionRepositoryTest.php index 3e8710194..365c44154 100644 --- a/tests/Integration/Repository/CollectionRepositoryTest.php +++ b/tests/Integration/Repository/CollectionRepositoryTest.php @@ -14,7 +14,6 @@ use ApiTestCase\JsonApiTestCase; use BitBag\SyliusCmsPlugin\Entity\CollectionInterface; use BitBag\SyliusCmsPlugin\Repository\CollectionRepositoryInterface; -use Doctrine\ORM\QueryBuilder; final class CollectionRepositoryTest extends JsonApiTestCase { @@ -23,26 +22,14 @@ public function setUp(): void parent::setUp(); } - public function test_it_creates_list_query_builder(): void - { - $repository = $this->getRepository(); - - $localeCode = 'en_US'; - $queryBuilder = $repository->createListQueryBuilder($localeCode); - - self::assertInstanceOf(QueryBuilder::class, $queryBuilder); - self::assertNotNull($queryBuilder->getQuery()); - } - public function test_it_finds_collection_by_name_part(): void { $this->loadFixturesFromFile('CollectionRepositoryTest/test_it_finds_collection_by_name.yml'); $repository = $this->getRepository(); - $phrase = 'translation'; - $locale = 'en_US'; - $collections = $repository->findByNamePart($phrase, $locale); + $phrase = 'collection'; + $collections = $repository->findByNamePart($phrase); self::assertIsArray($collections); self::assertCount(3, $collections); @@ -68,8 +55,7 @@ public function test_it_finds_by_codes_and_locale(): void $repository = $this->getRepository(); $codes = 'collection1-code,collection2-code'; - $localeCode = 'en_US'; - $collections = $repository->findByCodesAndLocale($codes, $localeCode); + $collections = $repository->findByCodes($codes); self::assertIsArray($collections); self::assertCount(2, $collections); diff --git a/tests/Integration/Repository/PageRepositoryTest.php b/tests/Integration/Repository/PageRepositoryTest.php index 53a2369ea..2d948d558 100644 --- a/tests/Integration/Repository/PageRepositoryTest.php +++ b/tests/Integration/Repository/PageRepositoryTest.php @@ -54,8 +54,8 @@ public function test_it_finds_enabled_page_by_collection_code(): void $pageRepository = $this->getRepository(); - $page1_array = $pageRepository->findByCollectionCode('collection1-code', 'en_US'); - $page3_array = $pageRepository->findByCollectionCode('collection3-code', 'en_US'); + $page1_array = $pageRepository->findByCollectionCode('collection1-code'); + $page3_array = $pageRepository->findByCollectionCode('collection3-code'); self::assertNotEmpty($page1_array); self::assertEmpty($page3_array);