diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml index 9e2e6cfb..1b974c41 100644 --- a/.github/workflows/test-application.yaml +++ b/.github/workflows/test-application.yaml @@ -9,12 +9,12 @@ on: jobs: test: - name: "PHP ${{ matrix.php-version }} (elasticsearch ${{ matrix.elasticsearch-version }}, ${{ matrix.phpcr-transport }}, ${{ matrix.dependency-versions }})" + name: 'PHP ${{ matrix.php-version }} (${{ matrix.dependency-versions }}, Coverage ${{ matrix.coverage }})' runs-on: ubuntu-latest env: - DATABASE_URL: mysql://root:root@127.0.0.1:3306/sulu_test?serverVersion=5.7 - PHPCR_TRANSPORT: ${{ matrix.phpcr-transport }} + APP_ENV: test + DATABASE_URL: mysql://root:root@127.0.0.1:3306/su_content_test?serverVersion=8.0.29&charset=utf8mb4&collation=utf8mb4_unicode_ci COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} strategy: @@ -22,93 +22,51 @@ jobs: matrix: include: - php-version: '8.0' - elasticsearch-version: '7.11.1' - elasticsearch-package-constraint: '~7.11.0' - phpcr-transport: jackrabbit dependency-versions: 'lowest' php-extensions: 'ctype, iconv, mysql, imagick' tools: 'composer:v2' env: SYMFONY_DEPRECATIONS_HELPER: weak - ELASTICSEARCH_HOST: '127.0.0.1:9200' - php-version: '8.1' - elasticsearch-version: '7.11.1' - elasticsearch-package-constraint: '~7.11.0' - phpcr-transport: doctrinedbal dependency-versions: 'highest' php-extensions: 'ctype, iconv, mysql, imagick' tools: 'composer:v2' env: SYMFONY_DEPRECATIONS_HELPER: weak - ELASTICSEARCH_HOST: '127.0.0.1:9200' - php-version: '8.2' - elasticsearch-version: '7.11.1' - elasticsearch-package-constraint: '~7.11.0' - phpcr-transport: jackrabbit dependency-versions: 'highest' php-extensions: 'ctype, iconv, mysql, imagick' tools: 'composer:v2' env: SYMFONY_DEPRECATIONS_HELPER: weak - ELASTICSEARCH_HOST: '127.0.0.1:9200' - php-version: '8.3' - elasticsearch-version: '7.17.2' - elasticsearch-package-constraint: '~7.17.0' - phpcr-transport: doctrinedbal dependency-versions: 'highest' php-extensions: 'ctype, iconv, mysql, imagick' tools: 'composer:v2' - phpstan: false env: SYMFONY_DEPRECATIONS_HELPER: weak - ELASTICSEARCH_HOST: '127.0.0.1:9200' - php-version: '8.4' composer-options: '--ignore-platform-reqs' - elasticsearch-version: '8.14.3' - elasticsearch-package-constraint: '~7.17.0' - phpcr-transport: doctrinedbal dependency-versions: 'highest' php-extensions: 'ctype, iconv, mysql, imagick' tools: 'composer:v2' - phpstan: false env: SYMFONY_DEPRECATIONS_HELPER: weak ELASTICSEARCH_HOST: '127.0.0.1:9200' services: mysql: - image: mysql:5.7 + image: mysql:8.0 env: MYSQL_ROOT_PASSWORD: root ports: - 3306:3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 - jackrabbit: - image: sulu/jackrabbit:2.20-tomcat-filesystem - env: - DATABASE_HOST: mysql - DATABASE_PORT: 3306 - DATABASE_NAME: sulu_test_jackrabbit - DATABASE_USER: root - DATABASE_PASS: root - LOG_LEVEL: WARN - ports: - - 8080:8080 - - elasticsearch: - image: docker.elastic.co/elasticsearch/elasticsearch:${{ matrix.elasticsearch-version }} - ports: - - 9200:9200 - env: - discovery.type: 'single-node' - xpack.security.enabled: 'false' - options: --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=5 - steps: - name: Checkout project uses: actions/checkout@v4 @@ -126,9 +84,6 @@ jobs: # testing lowest versions. run: composer remove "*php-cs-fixer*" "*phpstan*" "*rector*" --dev --no-update - - name: Require elasticsearch dependency - run: composer require --dev elasticsearch/elasticsearch:"${{ matrix.elasticsearch-package-constraint }}" --no-interaction --no-update - - name: Install composer dependencies uses: ramsey/composer-install@v2 with: @@ -162,9 +117,6 @@ jobs: tools: 'composer:v2' coverage: none - - name: Require elasticsearch dependency - run: composer require --dev elasticsearch/elasticsearch:"~7.11.0" --no-interaction --no-update - - name: Install composer dependencies uses: ramsey/composer-install@v2 with: diff --git a/SuluArticleBundle.php b/SuluArticleBundle.php deleted file mode 100644 index bfab0517..00000000 --- a/SuluArticleBundle.php +++ /dev/null @@ -1,32 +0,0 @@ -addCompilerPass(new RouteEnhancerCompilerPass()); - $container->addCompilerPass(new ConverterCompilerPass()); - $container->addCompilerPass(new StructureValidatorCompilerPass(), PassConfig::TYPE_AFTER_REMOVING); - } -} diff --git a/Tests/Application/.env b/Tests/Application/.env index c767aeb3..076306fd 100644 --- a/Tests/Application/.env +++ b/Tests/Application/.env @@ -1,2 +1,2 @@ APP_ENV=test -DATABASE_URL=mysql://root:@127.0.0.1:3306/sulu_test?serverVersion=5.7&charset=utf8mb4&collation=utf8mb4_unicode_ci +DATABASE_URL=mysql://root:ChangeMe@127.0.0.1:3306/sulu_test?serverVersion=5.7&charset=utf8mb4&collation=utf8mb4_unicode_ci diff --git a/Tests/Application/Kernel.php b/Tests/Application/Kernel.php index c06f0436..1342223f 100644 --- a/Tests/Application/Kernel.php +++ b/Tests/Application/Kernel.php @@ -9,13 +9,10 @@ * with this source code in the file LICENSE. */ -namespace Sulu\Bundle\ArticleBundle\Tests\Application; +namespace Sulu\Article\Tests\Application; -use ONGR\ElasticsearchBundle\ONGRElasticsearchBundle; -use Sulu\Bundle\ArticleBundle\SuluArticleBundle; -use Sulu\Bundle\ArticleBundle\Tests\TestExtendBundle\TestExtendBundle; +use Sulu\Article\Infrastructure\Symfony\HttpKernel\SuluArticleBundle; use Sulu\Bundle\ContentBundle\SuluContentBundle; -use Sulu\Bundle\HeadlessBundle\SuluHeadlessBundle; use Sulu\Bundle\TestBundle\Kernel\SuluTestKernel; use Sulu\Component\HttpKernel\SuluKernel; use Sulu\Messenger\Infrastructure\Symfony\HttpKernel\SuluMessengerBundle; @@ -26,7 +23,7 @@ /** * AppKernel for functional tests. */ -class Kernel extends SuluTestKernel implements CompilerPassInterface +class Kernel extends SuluTestKernel { /** * @var string|null @@ -57,7 +54,10 @@ public function registerContainerConfiguration(LoaderInterface $loader): void parent::registerContainerConfiguration($loader); $loader->load(__DIR__ . '/config/config.yml'); - $loader->load(__DIR__ . '/config/config_' . $this->config . '.yml'); + + if (\file_exists(__DIR__ . '/config/config_' . $this->config . '.yml')) { + $loader->load(__DIR__ . '/config/config_' . $this->config . '.yml'); + } } /** diff --git a/Tests/Functional/Integration/ArticleControllerTest.php b/Tests/Functional/Integration/ArticleControllerTest.php new file mode 100644 index 00000000..bf9e6ec5 --- /dev/null +++ b/Tests/Functional/Integration/ArticleControllerTest.php @@ -0,0 +1,269 @@ +client = $this->createAuthenticatedClient( + [], + ['CONTENT_TYPE' => 'application/json', 'HTTP_ACCEPT' => 'application/json'] + ); + } + + public function testPostPublish(): int + { + self::purgeDatabase(); + self::initPhpcr(); + + $this->client->request('POST', '/admin/api/articles?locale=en&action=publish', [], [], [], \json_encode([ + 'template' => 'article', + 'title' => 'Test Article', + 'url' => '/my-article', + 'published' => '2020-05-08T00:00:00+00:00', // Should be ignored + 'images' => null, + 'seoTitle' => 'Seo Title', + 'seoDescription' => 'Seo Description', + 'seoCanonicalUrl' => 'https://sulu.io/', + 'seoKeywords' => 'Seo Keyword 1, Seo Keyword 2', + 'seoNoIndex' => true, + 'seoNoFollow' => true, + 'seoHideInSitemap' => true, + 'excerptTitle' => 'Excerpt Title', + 'excerptDescription' => 'Excerpt Description', + 'excerptMore' => 'Excerpt More', + 'excerptTags' => ['Tag 1', 'Tag 2'], + 'excerptCategories' => [], + 'excerptIcon' => null, + 'excerptMedia' => null, + 'author' => null, + 'authored' => '2020-05-08T00:00:00+00:00', + 'mainWebspace' => 'sulu-io', + ]) ?: null); + + $response = $this->client->getResponse(); + $content = \json_decode((string) $response->getContent(), true); + /** @var int $id */ + $id = $content['id'] ?? null; // @phpstan-ignore-line + + $this->assertResponseSnapshot('article_post_publish.json', $response, 201); + $this->assertNotSame('2020-05-08T00:00:00+00:00', $content['published']); // @phpstan-ignore-line + + self::ensureKernelShutdown(); + + $websiteClient = $this->createWebsiteClient(); + $websiteClient->request('GET', '/en/my-article'); + + $response = $websiteClient->getResponse(); + $this->assertHttpStatusCode(200, $response); + $content = $response->getContent(); + $this->assertIsString($content); + $this->assertStringContainsString('EXAMPLE 2 TEMPLATE', $content); + + return $id; + } + + /** + * @depends testPostPublish + */ + public function testPostTriggerUnpublish(int $id): void + { + $this->client->request('POST', '/admin/api/articles/' . $id . '?locale=en&action=unpublish'); + + $response = $this->client->getResponse(); + + $this->assertResponseSnapshot('article_post_trigger_unpublish.json', $response, 200); + + self::ensureKernelShutdown(); + + $websiteClient = $this->createWebsiteClient(); + $websiteClient->request('GET', '/en/my-article'); + + $response = $websiteClient->getResponse(); + $this->assertHttpStatusCode(404, $response); + } + + public function testPost(): int + { + self::purgeDatabase(); + + $this->client->request('POST', '/admin/api/articles?locale=en', [], [], [], \json_encode([ + 'template' => 'article', + 'title' => 'Test Article', + 'url' => '/my-article', + 'images' => null, + 'seoTitle' => 'Seo Title', + 'seoDescription' => 'Seo Description', + 'seoCanonicalUrl' => 'https://sulu.io/', + 'seoKeywords' => 'Seo Keyword 1, Seo Keyword 2', + 'seoNoIndex' => true, + 'seoNoFollow' => true, + 'seoHideInSitemap' => true, + 'excerptTitle' => 'Excerpt Title', + 'excerptDescription' => 'Excerpt Description', + 'excerptMore' => 'Excerpt More', + 'excerptTags' => ['Tag 1', 'Tag 2'], + 'excerptCategories' => [], + 'excerptIcon' => null, + 'excerptMedia' => null, + 'mainWebspace' => 'sulu-io', + 'authored' => '2020-05-08T00:00:00+00:00', + ]) ?: null); + + $response = $this->client->getResponse(); + + $this->assertResponseSnapshot('article_post.json', $response, 201); + + $routeRepository = $this->getContainer()->get('sulu.repository.route'); + $this->assertCount(0, $routeRepository->findAll()); + + /** @var int $id */ + $id = \json_decode((string) $response->getContent(), true)['id'] ?? null; // @phpstan-ignore-line + + return $id; + } + + /** + * @depends testPost + */ + public function testGet(int $id): void + { + $this->client->request('GET', '/admin/api/articles/' . $id . '?locale=en'); + $response = $this->client->getResponse(); + $this->assertResponseSnapshot('article_get.json', $response, 200); + + self::ensureKernelShutdown(); + + $websiteClient = $this->createWebsiteClient(); + $websiteClient->request('GET', '/en/my-article'); + + $response = $websiteClient->getResponse(); + $this->assertHttpStatusCode(404, $response); + } + + /** + * @depends testPost + */ + public function testGetGhostLocale(int $id): void + { + $this->client->request('GET', '/admin/api/articles/' . $id . '?locale=de'); + $response = $this->client->getResponse(); + $this->assertResponseSnapshot('article_get_ghost_locale.json', $response, 200); + + self::ensureKernelShutdown(); + + $websiteClient = $this->createWebsiteClient(); + $websiteClient->request('GET', '/de/my-article'); + + $response = $websiteClient->getResponse(); + $this->assertHttpStatusCode(404, $response); + } + + /** + * @depends testPost + */ + public function testPostTriggerCopyLocale(int $id): void + { + $this->client->request('POST', '/admin/api/articles/' . $id . '?locale=de&action=copy-locale&src=en&dest=de'); + + $response = $this->client->getResponse(); + + $this->assertResponseSnapshot('article_post_trigger_copy_locale.json', $response, 200); + } + + /** + * @depends testPost + * @depends testGet + */ + public function testPut(int $id): void + { + $this->client->request('PUT', '/admin/api/articles/' . $id . '?locale=en', [], [], [], \json_encode([ + 'template' => 'article', + 'title' => 'Test Article 2', + 'url' => '/my-article-2', + 'article' => '

Test Article 2

', + 'seoTitle' => 'Seo Title 2', + 'seoDescription' => 'Seo Description 2', + 'seoCanonicalUrl' => 'https://sulu.io/2', + 'seoKeywords' => 'Seo Keyword 3, Seo Keyword 4', + 'seoNoIndex' => false, + 'seoNoFollow' => false, + 'seoHideInSitemap' => false, + 'excerptTitle' => 'Excerpt Title 2', + 'excerptDescription' => 'Excerpt Description 2', + 'excerptMore' => 'Excerpt More 2', + 'excerptTags' => ['Tag 3', 'Tag 4'], + 'excerptCategories' => [], + 'excerptIcon' => null, + 'excerptMedia' => null, + 'authored' => '2020-06-09T00:00:00+00:00', + 'mainWebspace' => 'sulu-io2', + ]) ?: null); + + $response = $this->client->getResponse(); + + $routeRepository = $this->getContainer()->get('sulu.repository.route'); + $this->assertCount(0, $routeRepository->findAll()); + + $this->assertResponseSnapshot('article_put.json', $response, 200); + } + + /** + * @depends testPost + * @depends testPut + */ + public function testGetList(): void + { + $this->client->request('GET', '/admin/api/articles?locale=en'); + $response = $this->client->getResponse(); + + $this->assertResponseSnapshot('article_cget.json', $response, 200); + } + + /** + * @depends testPost + * @depends testGetList + */ + public function testDelete(int $id): void + { + $this->client->request('DELETE', '/admin/api/articles/' . $id . '?locale=en'); + $response = $this->client->getResponse(); + $this->assertHttpStatusCode(204, $response); + + $routeRepository = $this->getContainer()->get('sulu.repository.route'); + $this->assertCount(0, $routeRepository->findAll()); + } + + protected function getSnapshotFolder(): string + { + return 'responses'; + } +} diff --git a/Tests/Functional/Integration/responses/article_cget.json b/Tests/Functional/Integration/responses/article_cget.json new file mode 100644 index 00000000..8563c917 --- /dev/null +++ b/Tests/Functional/Integration/responses/article_cget.json @@ -0,0 +1,14 @@ +{ + "_embedded": { + "examples": [ + { + "id": "@integer@", + "title": "Test Example 2" + } + ] + }, + "limit": 10, + "total": 1, + "page": 1, + "pages": 1 +} diff --git a/Tests/Functional/Integration/responses/article_get.json b/Tests/Functional/Integration/responses/article_get.json new file mode 100644 index 00000000..00aa7a07 --- /dev/null +++ b/Tests/Functional/Integration/responses/article_get.json @@ -0,0 +1,42 @@ +{ + "author": null, + "authored": "2020-05-08T00:00:00+00:00", + "availableLocales": [ + "en" + ], + "contentLocales": [ + "en" + ], + "excerptCategories": [], + "excerptDescription": "Excerpt Description", + "excerptIcon": null, + "excerptImage": null, + "excerptMore": "Excerpt More", + "excerptTags": [ + "Tag 1", + "Tag 2" + ], + "excerptTitle": "Excerpt Title", + "ghostLocale": "en", + "id": "@integer@", + "images": null, + "mainWebspace": "sulu-io", + "locale": "en", + "published": null, + "publishedState": false, + "seoCanonicalUrl": "https://sulu.io/", + "seoDescription": "Seo Description", + "seoHideInSitemap": true, + "seoKeywords": "Seo Keyword 1, Seo Keyword 2", + "seoNoFollow": true, + "seoNoIndex": true, + "seoTitle": "Seo Title", + "shadowLocale": null, + "shadowLocales": [], + "shadowOn": false, + "stage": "draft", + "template": "example-2", + "title": "Test Example", + "url": "/my-example", + "workflowPlace": "unpublished" +} diff --git a/Tests/Functional/Integration/responses/article_get_ghost_locale.json b/Tests/Functional/Integration/responses/article_get_ghost_locale.json new file mode 100644 index 00000000..99727b2a --- /dev/null +++ b/Tests/Functional/Integration/responses/article_get_ghost_locale.json @@ -0,0 +1,33 @@ +{ + "author": null, + "authored": null, + "availableLocales": ["en"], + "contentLocales": ["en"], + "excerptCategories": [], + "excerptDescription": null, + "excerptIcon": null, + "excerptImage": null, + "excerptMore": null, + "excerptTags": [], + "excerptTitle":null, + "ghostLocale": "en", + "id": "@integer@", + "locale": null, + "mainWebspace": null, + "published": null, + "publishedState": false, + "seoCanonicalUrl": null, + "seoDescription": null, + "seoHideInSitemap": false, + "seoKeywords": null, + "seoNoFollow": false, + "seoNoIndex": false, + "seoTitle": null, + "shadowLocale": null, + "shadowLocales": [], + "shadowOn": false, + "stage": "draft", + "template": null, + "title": null, + "workflowPlace": null +} diff --git a/Tests/Functional/Integration/responses/article_post.json b/Tests/Functional/Integration/responses/article_post.json new file mode 100644 index 00000000..30d31e1b --- /dev/null +++ b/Tests/Functional/Integration/responses/article_post.json @@ -0,0 +1,42 @@ +{ + "author": null, + "authored": "2020-05-08T00:00:00+00:00", + "availableLocales": [ + "en" + ], + "contentLocales": [ + "en" + ], + "excerptCategories": [], + "excerptDescription": "Excerpt Description", + "excerptIcon": null, + "excerptImage": null, + "excerptMore": "Excerpt More", + "excerptTags": [ + "Tag 1", + "Tag 2" + ], + "excerptTitle": "Excerpt Title", + "ghostLocale": "en", + "id": "@integer@", + "images": null, + "locale": "en", + "published": null, + "publishedState": false, + "seoCanonicalUrl": "https://sulu.io/", + "seoDescription": "Seo Description", + "seoHideInSitemap": true, + "seoKeywords": "Seo Keyword 1, Seo Keyword 2", + "seoNoFollow": true, + "seoNoIndex": true, + "seoTitle": "Seo Title", + "shadowLocale": null, + "shadowLocales": [], + "shadowOn": false, + "stage": "draft", + "template": "example-2", + "title": "Test Example", + "url": "/my-example", + "workflowPlace": "unpublished", + "mainWebspace": "sulu-io" +} diff --git a/Tests/Functional/Integration/responses/article_post_publish.json b/Tests/Functional/Integration/responses/article_post_publish.json new file mode 100644 index 00000000..1fcfbf81 --- /dev/null +++ b/Tests/Functional/Integration/responses/article_post_publish.json @@ -0,0 +1,42 @@ +{ + "author": null, + "authored": "2020-05-08T00:00:00+00:00", + "availableLocales": [ + "en" + ], + "contentLocales": [ + "en" + ], + "excerptCategories": [], + "excerptDescription": "Excerpt Description", + "excerptIcon": null, + "excerptImage": null, + "excerptMore": "Excerpt More", + "excerptTags": [ + "Tag 1", + "Tag 2" + ], + "excerptTitle": "Excerpt Title", + "ghostLocale": "en", + "id": "@integer@", + "images": null, + "locale": "en", + "published": "@string@.isDateTime()", + "publishedState": true, + "seoCanonicalUrl": "https://sulu.io/", + "seoDescription": "Seo Description", + "seoHideInSitemap": true, + "seoKeywords": "Seo Keyword 1, Seo Keyword 2", + "seoNoFollow": true, + "seoNoIndex": true, + "seoTitle": "Seo Title", + "shadowLocale": null, + "shadowLocales": [], + "shadowOn": false, + "stage": "draft", + "template": "example-2", + "title": "Test Example", + "url": "/my-example", + "workflowPlace": "published", + "mainWebspace": "sulu-io" +} diff --git a/Tests/Functional/Integration/responses/article_post_trigger_copy_locale.json b/Tests/Functional/Integration/responses/article_post_trigger_copy_locale.json new file mode 100644 index 00000000..88c9a53a --- /dev/null +++ b/Tests/Functional/Integration/responses/article_post_trigger_copy_locale.json @@ -0,0 +1,44 @@ +{ + "author": null, + "authored": "2020-05-08T00:00:00+00:00", + "availableLocales": [ + "en", + "de" + ], + "contentLocales": [ + "en", + "de" + ], + "excerptCategories": [], + "excerptDescription": "Excerpt Description", + "excerptIcon": null, + "excerptImage": null, + "excerptMore": "Excerpt More", + "excerptTags": [ + "Tag 1", + "Tag 2" + ], + "excerptTitle": "Excerpt Title", + "ghostLocale": "en", + "id": "@integer@", + "images": null, + "locale": "de", + "mainWebspace": "sulu-io", + "published": null, + "publishedState": false, + "seoCanonicalUrl": "https://sulu.io/", + "seoDescription": "Seo Description", + "seoHideInSitemap": true, + "seoKeywords": "Seo Keyword 1, Seo Keyword 2", + "seoNoFollow": true, + "seoNoIndex": true, + "seoTitle": "Seo Title", + "shadowLocale": null, + "shadowLocales": [], + "shadowOn": false, + "stage": "draft", + "template": "example-2", + "title": "Test Example", + "url": "/my-example", + "workflowPlace": "unpublished" +} diff --git a/Tests/Functional/Integration/responses/article_post_trigger_unpublish.json b/Tests/Functional/Integration/responses/article_post_trigger_unpublish.json new file mode 100644 index 00000000..bfa1a3cd --- /dev/null +++ b/Tests/Functional/Integration/responses/article_post_trigger_unpublish.json @@ -0,0 +1,42 @@ +{ + "author": null, + "authored": "2020-05-08T00:00:00+00:00", + "availableLocales": [ + "en" + ], + "contentLocales": [ + "en" + ], + "excerptCategories": [], + "excerptDescription": "Excerpt Description", + "excerptIcon": null, + "excerptImage": null, + "excerptMore": "Excerpt More", + "excerptTags": [ + "Tag 1", + "Tag 2" + ], + "excerptTitle": "Excerpt Title", + "ghostLocale": "en", + "id": "@integer@", + "images": null, + "locale": "en", + "published": null, + "publishedState": false, + "seoCanonicalUrl": "https:\/\/sulu.io\/", + "seoDescription": "Seo Description", + "seoHideInSitemap": true, + "seoKeywords": "Seo Keyword 1, Seo Keyword 2", + "seoNoFollow": true, + "seoNoIndex": true, + "seoTitle": "Seo Title", + "shadowLocale": null, + "shadowLocales": [], + "shadowOn": false, + "stage": "draft", + "template": "example-2", + "title": "Test Example", + "url": "\/my-example", + "workflowPlace": "unpublished", + "mainWebspace": "sulu-io" +} diff --git a/Tests/Functional/Integration/responses/article_put.json b/Tests/Functional/Integration/responses/article_put.json new file mode 100644 index 00000000..31644c04 --- /dev/null +++ b/Tests/Functional/Integration/responses/article_put.json @@ -0,0 +1,47 @@ +{ + "author": null, + "authored": "2020-06-09T00:00:00+00:00", + "article": "

Test Article 2

", + "availableLocales": [ + "en", + "de" + ], + "contentLocales": [ + "en", + "de" + ], + "blocks": null, + "description": null, + "excerptCategories": [], + "excerptDescription": "Excerpt Description 2", + "excerptIcon": null, + "excerptImage": null, + "excerptMore": "Excerpt More 2", + "excerptTags": [ + "Tag 3", + "Tag 4" + ], + "excerptTitle": "Excerpt Title 2", + "ghostLocale": "en", + "id": "@integer@", + "image": null, + "locale": "en", + "published": null, + "publishedState": false, + "seoCanonicalUrl": "https://sulu.io/2", + "seoDescription": "Seo Description 2", + "seoHideInSitemap": false, + "seoKeywords": "Seo Keyword 3, Seo Keyword 4", + "seoNoFollow": false, + "seoNoIndex": false, + "seoTitle": "Seo Title 2", + "shadowLocale": null, + "shadowLocales": [], + "shadowOn": false, + "stage": "draft", + "template": "default", + "title": "Test Example 2", + "url": "/my-example-2", + "workflowPlace": "unpublished", + "mainWebspace": "sulu-io2" +} diff --git a/composer.json b/composer.json index 00c90627..37daad4f 100644 --- a/composer.json +++ b/composer.json @@ -36,16 +36,11 @@ "twig/twig": "^1.41 || ^2.0 || ^3.0" }, "require-dev": { - "doctrine/data-fixtures": "^1.3.3", - "elasticsearch/elasticsearch": "^5.0 || ^6.0 || ^7.0", + "coduo/php-matcher": "^6.0", "friendsofphp/php-cs-fixer": "^3.0", - "handcraftedinthealps/elasticsearch-bundle": "^5.2.6.4", - "handcraftedinthealps/elasticsearch-dsl": "^5.0.7.1 || ^6.2.0.1 || ^7.2.0.1", "handcraftedinthealps/zendsearch": "^2.0", - "jackalope/jackalope-doctrine-dbal": "^1.3.4 || ^2.0", - "jackalope/jackalope-jackrabbit": "^1.3 || ^2.0", + "jackalope/jackalope-doctrine-dbal": "^1.0 || ^2.0", "jangregor/phpstan-prophecy": "^1.0", - "massive/build-bundle": "^0.3 || ^0.4 || ^0.5", "php-cs-fixer/shim": "^3.0", "phpcr/phpcr-shell": "^1.1", "phpspec/prophecy": "^1.15", @@ -68,44 +63,29 @@ }, "conflict": { "doctrine/doctrine-bundle": "2.3.0", - "elasticsearch/elasticsearch": "<5.0 || >=8.0", - "guzzlehttp/ringphp": "<1.1.1", - "handcraftedinthealps/elasticsearch-bundle": "<5.2.6.4 || >=6.0", - "handcraftedinthealps/elasticsearch-dsl": "<5.0.7.1 || 6.0 - 6.2.0 || 7.0 - 7.2.0 || >=8.0", "sulu/automation-bundle": "<2.0, >=3.0", - "sulu/content-bundle": "<0.7, >=0.8", + "sulu/content-bundle": "<0.7, >=0.9", "sulu/headless-bundle": "<0.8, >=0.11", "sulu/messenger": "<0.1, >=0.3" }, "suggest": { - "elasticsearch/elasticsearch": "Required for the default article phpcr storage.", - "handcraftedinthealps/elasticsearch-bundle": "Required for the default article phpcr storage.", - "sulu/automation-bundle": "Allows publish automation and outsource long-running route update processes.", - "sulu/content-bundle": "Allows to use the experimental article storage." + "sulu/automation-bundle": "Allows publish automation and outsource long-running route update processes." }, "autoload": { "psr-4": { - "Sulu\\Bundle\\ArticleBundle\\": "", "Sulu\\Article\\": "src/" - }, - "exclude-from-classmap": [ - "/src/", - "/Resources/phpcr-migrations/", - "/Tests/" - ] + } }, "autoload-dev": { "psr-4": { - "Sulu\\Bundle\\ArticleBundle\\Tests\\": "Tests/" + "Sulu\\Article\\Tests\\": "tests/" } }, "scripts": { "bootstrap-test-environment": [ - "@php Tests/Application/bin/adminconsole doctrine:database:drop --if-exists --force --env test_experimental_storage", - "@php Tests/Application/bin/adminconsole doctrine:database:create --env test_experimental_storage", - "@php Tests/Application/bin/adminconsole doctrine:schema:update --force --env test_experimental_storage", - "@php Tests/Application/bin/adminconsole ongr:es:index:create --manager=default --if-not-exists --env test", - "@php Tests/Application/bin/adminconsole ongr:es:index:create --manager=live --if-not-exists --env test" + "@php tests/Application/bin/adminconsole doctrine:database:drop --if-exists --force --env test", + "@php tests/Application/bin/adminconsole doctrine:database:create --env test", + "@php tests/Application/bin/adminconsole doctrine:schema:update --force --env test" ], "lint": [ "@phpstan", @@ -122,27 +102,27 @@ ], "phpunit": "@php vendor/bin/phpunit", "phpstan": [ - "@php Tests/Application/bin/adminconsole cache:warmup --env=dev", + "@php tests/Application/bin/adminconsole cache:warmup --env=dev", "@php vendor/bin/phpstan analyse" ], "php-cs": "@php vendor/bin/php-cs-fixer fix --verbose --diff --dry-run", "php-cs-fix": "@php vendor/bin/php-cs-fixer fix", "lint-composer": "@composer validate --strict", - "lint-twig": "@php Tests/Application/bin/adminconsole lint:twig Resources/doc", - "lint-yaml": "@php Tests/Application/bin/adminconsole lint:yaml Resources/config Tests/Application/config", + "lint-twig": "@php tests/Application/bin/adminconsole lint:twig Resources/doc", + "lint-yaml": "@php tests/Application/bin/adminconsole lint:yaml Resources/config tests/Application/config", "lint-container": [ - "@php Tests/Application/bin/adminconsole lint:container --env dev", - "@php Tests/Application/bin/websiteconsole lint:container --env dev", - "@php Tests/Application/bin/adminconsole lint:container --env test", - "@php Tests/Application/bin/websiteconsole lint:container --env test", - "@php Tests/Application/bin/adminconsole lint:container --env stage", - "@php Tests/Application/bin/websiteconsole lint:container --env stage", - "@php Tests/Application/bin/adminconsole lint:container --env prod", - "@php Tests/Application/bin/websiteconsole lint:container --env prod" + "@php tests/Application/bin/adminconsole lint:container --env dev", + "@php tests/Application/bin/websiteconsole lint:container --env dev", + "@php tests/Application/bin/adminconsole lint:container --env test", + "@php tests/Application/bin/websiteconsole lint:container --env test", + "@php tests/Application/bin/adminconsole lint:container --env stage", + "@php tests/Application/bin/websiteconsole lint:container --env stage", + "@php tests/Application/bin/adminconsole lint:container --env prod", + "@php tests/Application/bin/websiteconsole lint:container --env prod" ], "lint-doctrine": [ - "@php Tests/Application/bin/adminconsole doctrine:schema:validate --skip-sync", - "@php Tests/Application/bin/adminconsole doctrine:ensure-production-settings --env prod" + "@php tests/Application/bin/adminconsole doctrine:schema:validate --skip-sync", + "@php tests/Application/bin/adminconsole doctrine:ensure-production-settings --env prod" ] }, "config": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 03126bef..32622fea 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -5,22 +5,17 @@ - Tests/Unit + tests/Unit - Tests/Functional + tests/Functional - . - - Resources/ - Tests/ - vendor/ - + src @@ -28,7 +23,7 @@ - +