Loading core/.phpstan-baseline.php +12 −12 Original line number Diff line number Diff line Loading @@ -22663,6 +22663,18 @@ 'count' => 1, 'path' => __DIR__ . '/modules/search/tests/src/Functional/Update/SearchBlockPageIdUpdatePathTest.php', ]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\search\\\\Functional\\\\views\\\\ViewsIntegrationTest\\:\\:cronRun\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', 'count' => 1, 'path' => __DIR__ . '/modules/search/tests/src/Functional/views/ViewsIntegrationTest.php', ]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\search\\\\Functional\\\\views\\\\ViewsMultilingualTest\\:\\:cronRun\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', 'count' => 1, 'path' => __DIR__ . '/modules/search/tests/src/Functional/views/ViewsMultilingualTest.php', ]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\search\\\\Kernel\\\\SearchMatchTest\\:\\:getText\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', Loading Loading @@ -35025,18 +35037,6 @@ 'count' => 1, 'path' => __DIR__ . '/modules/views/tests/src/Functional/Plugin/PagerTest.php', ]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\views\\\\Functional\\\\SearchIntegrationTest\\:\\:cronRun\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', 'count' => 1, 'path' => __DIR__ . '/modules/views/tests/src/Functional/SearchIntegrationTest.php', ]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\views\\\\Functional\\\\SearchMultilingualTest\\:\\:cronRun\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', 'count' => 1, 'path' => __DIR__ . '/modules/views/tests/src/Functional/SearchMultilingualTest.php', ]; $ignoreErrors[] = [ 'message' => '#^Variable \\$link might not be defined\\.$#', 'identifier' => 'variable.undefined', core/modules/node/tests/src/Functional/NodeTranslationUITest.php +0 −62 Original line number Diff line number Diff line Loading @@ -622,68 +622,6 @@ public function testUrlPrefixOnLanguageNeutralContent(): void { } } /** * Test deletion of translated content from search and index rebuild. */ public function testSearchIndexRebuildOnTranslationDeletion(): void { \Drupal::service('module_installer')->install(['search']); $admin_user = $this->drupalCreateUser([ 'administer site configuration', 'access administration pages', 'administer content types', 'delete content translations', 'administer content translation', 'translate any entity', 'administer search', 'search content', 'delete any article content', ]); $this->drupalLogin($admin_user); // Create a node. $node = $this->drupalCreateNode([ 'type' => $this->bundle, ]); // Add a French translation. $translation = $node->addTranslation('fr'); $translation->title = 'First rev fr title'; $translation->setNewRevision(FALSE); $translation->save(); // Check if 1 page is listed for indexing. $this->drupalGet('admin/config/search/pages'); $this->assertSession()->pageTextContains('There is 1 item left to index.'); // Run cron. $this->drupalGet('admin/config/system/cron'); $this->getSession()->getPage()->pressButton('Run cron'); // Assert no items are left for indexing. $this->drupalGet('admin/config/search/pages'); $this->assertSession()->pageTextContains('There are 0 items left to index.'); // Search for French content. $this->drupalGet('search/node', ['query' => ['keys' => urlencode('First rev fr title')]]); $this->assertSession()->pageTextContains('First rev fr title'); // Delete translation. $this->drupalGet('fr/node/' . $node->id() . '/delete'); $this->getSession()->getPage()->pressButton('Delete French translation'); // Run cron. $this->drupalGet('admin/config/system/cron'); $this->getSession()->getPage()->pressButton('Run cron'); // Assert no items are left for indexing. $this->drupalGet('admin/config/search/pages'); $this->assertSession()->pageTextContains('There are 0 items left to index.'); // Search for French content. $this->drupalGet('search/node', ['query' => ['keys' => urlencode('First rev fr title')]]); $this->assertSession()->pageTextNotContains('First rev fr title'); } /** * Tests redirection after saving translation. */ Loading core/modules/page_cache/tests/src/Functional/PageCacheTagsIntegrationTest.php +1 −7 Original line number Diff line number Diff line Loading @@ -48,7 +48,6 @@ class PageCacheTagsIntegrationTest extends BrowserTestBase { 'language', 'help', 'node', 'search', 'views', ]; Loading Loading @@ -84,10 +83,9 @@ public function testPageCacheTags(): void { $this->drupalCreateContentType(['type' => 'page', 'title' => 'Basic page']); $this->addDefaultCommentField('node', 'page'); // To generate search and comment tags. // To generate comment tags. $anonymous = Role::load(RoleInterface::ANONYMOUS_ID); $anonymous ->grantPermission('search content') ->grantPermission('access comments'); $anonymous->save(); Loading Loading @@ -145,11 +143,9 @@ public function testPageCacheTags(): void { 'local_task', 'config:block_list', 'node_view', 'CACHE_MISS_IF_UNCACHEABLE_HTTP_METHOD:form', 'node:' . $node_1->id(), 'user:' . $author_1->id(), 'config:filter.format.basic_html', 'config:search.settings', 'config:system.menu.account', 'config:system.menu.main', 'config:system.site', Loading @@ -168,11 +164,9 @@ public function testPageCacheTags(): void { 'local_task', 'config:block_list', 'node_view', 'CACHE_MISS_IF_UNCACHEABLE_HTTP_METHOD:form', 'node:' . $node_2->id(), 'user:' . $author_2->id(), 'config:filter.format.full_html', 'config:search.settings', 'config:system.menu.account', 'config:system.menu.main', 'config:system.site', Loading core/modules/search/tests/src/Functional/SearchNodeTranslationUITest.php 0 → 100644 +111 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace Drupal\Tests\search\Functional; use Drupal\Tests\content_translation\Functional\ContentTranslationTestBase; use Drupal\Tests\language\Traits\LanguageTestTrait; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses; /** * Tests search index rebuild on translated content deletion. */ #[Group('search')] #[RunTestsInSeparateProcesses] class SearchNodeTranslationUITest extends ContentTranslationTestBase { use LanguageTestTrait; /** * {@inheritdoc} */ protected $defaultTheme = 'stark'; /** * {@inheritdoc} */ protected static $modules = [ 'content_translation', 'node', 'search', ]; /** * {@inheritdoc} */ protected function setUp(): void { $this->entityTypeId = 'node'; $this->bundle = 'article'; parent::setUp(); // Create the bundle. $this->drupalCreateContentType(['type' => 'article', 'title' => 'Article']); $this->doSetup(); $this->drupalLogin($this->translator); } /** * Test deletion of translated content from search and index rebuild. */ public function testSearchIndexRebuildOnTranslationDeletion(): void { $admin_user = $this->drupalCreateUser([ 'administer site configuration', 'access administration pages', 'administer content types', 'delete content translations', 'administer content translation', 'translate any entity', 'administer search', 'search content', 'delete any article content', ]); $this->drupalLogin($admin_user); // Create a node. $node = $this->drupalCreateNode([ 'type' => 'article', ]); // Add a French translation. $translation = $node->addTranslation('fr'); $translation->title = 'First rev fr title'; $translation->setNewRevision(FALSE); $translation->save(); // Check if 1 page is listed for indexing. $this->drupalGet('admin/config/search/pages'); $this->assertSession()->pageTextContains('There is 1 item left to index.'); // Run cron. $this->drupalGet('admin/config/system/cron'); $this->getSession()->getPage()->pressButton('Run cron'); // Assert no items are left for indexing. $this->drupalGet('admin/config/search/pages'); $this->assertSession()->pageTextContains('There are 0 items left to index.'); // Search for French content. $this->drupalGet('search/node', ['query' => ['keys' => urlencode('First rev fr title')]]); $this->assertSession()->pageTextContains('First rev fr title'); // Delete translation. $this->drupalGet('fr/node/' . $node->id() . '/delete'); $this->getSession()->getPage()->pressButton('Delete French translation'); // Run cron. $this->drupalGet('admin/config/system/cron'); $this->getSession()->getPage()->pressButton('Run cron'); // Assert no items are left for indexing. $this->drupalGet('admin/config/search/pages'); $this->assertSession()->pageTextContains('There are 0 items left to index.'); // Search for French content. $this->drupalGet('search/node', ['query' => ['keys' => urlencode('First rev fr title')]]); $this->assertSession()->pageTextNotContains('First rev fr title'); } } core/modules/views/tests/src/Functional/SearchIntegrationTest.php→core/modules/search/tests/src/Functional/views/ViewsIntegrationTest.php +4 −3 Original line number Diff line number Diff line Loading @@ -2,18 +2,19 @@ declare(strict_types=1); namespace Drupal\Tests\views\Functional; namespace Drupal\Tests\search\Functional\views; use Drupal\Tests\Traits\Core\CronRunTrait; use Drupal\Tests\views\Functional\ViewTestBase; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses; /** * Tests search integration filters. */ #[Group('views')] #[Group('search')] #[RunTestsInSeparateProcesses] class SearchIntegrationTest extends ViewTestBase { class ViewsIntegrationTest extends ViewTestBase { use CronRunTrait; Loading Loading
core/.phpstan-baseline.php +12 −12 Original line number Diff line number Diff line Loading @@ -22663,6 +22663,18 @@ 'count' => 1, 'path' => __DIR__ . '/modules/search/tests/src/Functional/Update/SearchBlockPageIdUpdatePathTest.php', ]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\search\\\\Functional\\\\views\\\\ViewsIntegrationTest\\:\\:cronRun\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', 'count' => 1, 'path' => __DIR__ . '/modules/search/tests/src/Functional/views/ViewsIntegrationTest.php', ]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\search\\\\Functional\\\\views\\\\ViewsMultilingualTest\\:\\:cronRun\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', 'count' => 1, 'path' => __DIR__ . '/modules/search/tests/src/Functional/views/ViewsMultilingualTest.php', ]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\search\\\\Kernel\\\\SearchMatchTest\\:\\:getText\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', Loading Loading @@ -35025,18 +35037,6 @@ 'count' => 1, 'path' => __DIR__ . '/modules/views/tests/src/Functional/Plugin/PagerTest.php', ]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\views\\\\Functional\\\\SearchIntegrationTest\\:\\:cronRun\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', 'count' => 1, 'path' => __DIR__ . '/modules/views/tests/src/Functional/SearchIntegrationTest.php', ]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\views\\\\Functional\\\\SearchMultilingualTest\\:\\:cronRun\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', 'count' => 1, 'path' => __DIR__ . '/modules/views/tests/src/Functional/SearchMultilingualTest.php', ]; $ignoreErrors[] = [ 'message' => '#^Variable \\$link might not be defined\\.$#', 'identifier' => 'variable.undefined',
core/modules/node/tests/src/Functional/NodeTranslationUITest.php +0 −62 Original line number Diff line number Diff line Loading @@ -622,68 +622,6 @@ public function testUrlPrefixOnLanguageNeutralContent(): void { } } /** * Test deletion of translated content from search and index rebuild. */ public function testSearchIndexRebuildOnTranslationDeletion(): void { \Drupal::service('module_installer')->install(['search']); $admin_user = $this->drupalCreateUser([ 'administer site configuration', 'access administration pages', 'administer content types', 'delete content translations', 'administer content translation', 'translate any entity', 'administer search', 'search content', 'delete any article content', ]); $this->drupalLogin($admin_user); // Create a node. $node = $this->drupalCreateNode([ 'type' => $this->bundle, ]); // Add a French translation. $translation = $node->addTranslation('fr'); $translation->title = 'First rev fr title'; $translation->setNewRevision(FALSE); $translation->save(); // Check if 1 page is listed for indexing. $this->drupalGet('admin/config/search/pages'); $this->assertSession()->pageTextContains('There is 1 item left to index.'); // Run cron. $this->drupalGet('admin/config/system/cron'); $this->getSession()->getPage()->pressButton('Run cron'); // Assert no items are left for indexing. $this->drupalGet('admin/config/search/pages'); $this->assertSession()->pageTextContains('There are 0 items left to index.'); // Search for French content. $this->drupalGet('search/node', ['query' => ['keys' => urlencode('First rev fr title')]]); $this->assertSession()->pageTextContains('First rev fr title'); // Delete translation. $this->drupalGet('fr/node/' . $node->id() . '/delete'); $this->getSession()->getPage()->pressButton('Delete French translation'); // Run cron. $this->drupalGet('admin/config/system/cron'); $this->getSession()->getPage()->pressButton('Run cron'); // Assert no items are left for indexing. $this->drupalGet('admin/config/search/pages'); $this->assertSession()->pageTextContains('There are 0 items left to index.'); // Search for French content. $this->drupalGet('search/node', ['query' => ['keys' => urlencode('First rev fr title')]]); $this->assertSession()->pageTextNotContains('First rev fr title'); } /** * Tests redirection after saving translation. */ Loading
core/modules/page_cache/tests/src/Functional/PageCacheTagsIntegrationTest.php +1 −7 Original line number Diff line number Diff line Loading @@ -48,7 +48,6 @@ class PageCacheTagsIntegrationTest extends BrowserTestBase { 'language', 'help', 'node', 'search', 'views', ]; Loading Loading @@ -84,10 +83,9 @@ public function testPageCacheTags(): void { $this->drupalCreateContentType(['type' => 'page', 'title' => 'Basic page']); $this->addDefaultCommentField('node', 'page'); // To generate search and comment tags. // To generate comment tags. $anonymous = Role::load(RoleInterface::ANONYMOUS_ID); $anonymous ->grantPermission('search content') ->grantPermission('access comments'); $anonymous->save(); Loading Loading @@ -145,11 +143,9 @@ public function testPageCacheTags(): void { 'local_task', 'config:block_list', 'node_view', 'CACHE_MISS_IF_UNCACHEABLE_HTTP_METHOD:form', 'node:' . $node_1->id(), 'user:' . $author_1->id(), 'config:filter.format.basic_html', 'config:search.settings', 'config:system.menu.account', 'config:system.menu.main', 'config:system.site', Loading @@ -168,11 +164,9 @@ public function testPageCacheTags(): void { 'local_task', 'config:block_list', 'node_view', 'CACHE_MISS_IF_UNCACHEABLE_HTTP_METHOD:form', 'node:' . $node_2->id(), 'user:' . $author_2->id(), 'config:filter.format.full_html', 'config:search.settings', 'config:system.menu.account', 'config:system.menu.main', 'config:system.site', Loading
core/modules/search/tests/src/Functional/SearchNodeTranslationUITest.php 0 → 100644 +111 −0 Original line number Diff line number Diff line <?php declare(strict_types=1); namespace Drupal\Tests\search\Functional; use Drupal\Tests\content_translation\Functional\ContentTranslationTestBase; use Drupal\Tests\language\Traits\LanguageTestTrait; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses; /** * Tests search index rebuild on translated content deletion. */ #[Group('search')] #[RunTestsInSeparateProcesses] class SearchNodeTranslationUITest extends ContentTranslationTestBase { use LanguageTestTrait; /** * {@inheritdoc} */ protected $defaultTheme = 'stark'; /** * {@inheritdoc} */ protected static $modules = [ 'content_translation', 'node', 'search', ]; /** * {@inheritdoc} */ protected function setUp(): void { $this->entityTypeId = 'node'; $this->bundle = 'article'; parent::setUp(); // Create the bundle. $this->drupalCreateContentType(['type' => 'article', 'title' => 'Article']); $this->doSetup(); $this->drupalLogin($this->translator); } /** * Test deletion of translated content from search and index rebuild. */ public function testSearchIndexRebuildOnTranslationDeletion(): void { $admin_user = $this->drupalCreateUser([ 'administer site configuration', 'access administration pages', 'administer content types', 'delete content translations', 'administer content translation', 'translate any entity', 'administer search', 'search content', 'delete any article content', ]); $this->drupalLogin($admin_user); // Create a node. $node = $this->drupalCreateNode([ 'type' => 'article', ]); // Add a French translation. $translation = $node->addTranslation('fr'); $translation->title = 'First rev fr title'; $translation->setNewRevision(FALSE); $translation->save(); // Check if 1 page is listed for indexing. $this->drupalGet('admin/config/search/pages'); $this->assertSession()->pageTextContains('There is 1 item left to index.'); // Run cron. $this->drupalGet('admin/config/system/cron'); $this->getSession()->getPage()->pressButton('Run cron'); // Assert no items are left for indexing. $this->drupalGet('admin/config/search/pages'); $this->assertSession()->pageTextContains('There are 0 items left to index.'); // Search for French content. $this->drupalGet('search/node', ['query' => ['keys' => urlencode('First rev fr title')]]); $this->assertSession()->pageTextContains('First rev fr title'); // Delete translation. $this->drupalGet('fr/node/' . $node->id() . '/delete'); $this->getSession()->getPage()->pressButton('Delete French translation'); // Run cron. $this->drupalGet('admin/config/system/cron'); $this->getSession()->getPage()->pressButton('Run cron'); // Assert no items are left for indexing. $this->drupalGet('admin/config/search/pages'); $this->assertSession()->pageTextContains('There are 0 items left to index.'); // Search for French content. $this->drupalGet('search/node', ['query' => ['keys' => urlencode('First rev fr title')]]); $this->assertSession()->pageTextNotContains('First rev fr title'); } }
core/modules/views/tests/src/Functional/SearchIntegrationTest.php→core/modules/search/tests/src/Functional/views/ViewsIntegrationTest.php +4 −3 Original line number Diff line number Diff line Loading @@ -2,18 +2,19 @@ declare(strict_types=1); namespace Drupal\Tests\views\Functional; namespace Drupal\Tests\search\Functional\views; use Drupal\Tests\Traits\Core\CronRunTrait; use Drupal\Tests\views\Functional\ViewTestBase; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses; /** * Tests search integration filters. */ #[Group('views')] #[Group('search')] #[RunTestsInSeparateProcesses] class SearchIntegrationTest extends ViewTestBase { class ViewsIntegrationTest extends ViewTestBase { use CronRunTrait; Loading