Skip to content

Commit 5765121

Browse files
alexpottdrunken-monkey
alexpott
authored andcommitted
Issue #2861587 by alexpott: Fixed the DB/Defaults integration tests.
1 parent cce17c6 commit 5765121

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

CHANGELOG.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Search API 1.x, dev (xxxx-xx-xx):
22
---------------------------------
3+
- #2861587 by alexpott: Fixed the DB/Defaults integration tests.
34
- #2855758 by StryKaizer, drunken monkey: Fixed "is rendered" checks for Views
45
block displays.
56
- #2855444 by drunken monkey: Added language-specific test for the "Rendered

modules/search_api_db/search_api_db_defaults/tests/src/Functional/IntegrationTest.php

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Drupal\Tests\search_api_db_defaults;
3+
namespace Drupal\Tests\search_api_db_defaults\Functional;
44

55
use Drupal\comment\Tests\CommentTestTrait;
66
use Drupal\Core\StringTranslation\StringTranslationTrait;
@@ -57,21 +57,27 @@ public function setUp() {
5757
public function testInstallAndDefaultSetupWorking() {
5858
$this->drupalLogin($this->adminUser);
5959

60+
// Installation invokes a batch and this breaks it.
61+
\Drupal::state()->set('search_api_use_tracking_batch', FALSE);
62+
6063
// Install the search_api_db_defaults module.
61-
$edit_enable = [
62-
'modules[Search][search_api_db_defaults][enable]' => TRUE,
63-
];
64+
if (version_compare(\Drupal::VERSION, '8.3', '>=')){
65+
$edit_enable = [
66+
'modules[search_api_db_defaults][enable]' => TRUE,
67+
];
68+
}
69+
else {
70+
$edit_enable = [
71+
'modules[Search][search_api_db_defaults][enable]' => TRUE,
72+
];
73+
}
6474
$this->drupalPostForm('admin/modules', $edit_enable, t('Install'));
6575

6676
$this->assertSession()->pageTextContains(t('Some required modules must be enabled'));
6777

6878
$this->drupalPostForm(NULL, [], t('Continue'));
69-
$args = [
70-
'@count' => 3,
71-
'%names' => 'Database Search Defaults, Database Search, Search API',
72-
];
73-
$success_text = strip_tags(t('@count modules have been enabled: %names.', $args));
74-
$this->assertSession()->pageTextContains($success_text);
79+
80+
$this->assertSession()->pageTextContains('2 modules have been enabled: Database Search Defaults, Database Search');
7581

7682
$this->rebuildContainer();
7783

modules/search_api_db/tests/src/FunctionalJavascript/IntegrationTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Drupal\Tests\search_api_db;
3+
namespace Drupal\Tests\search_api_db\FunctionalJavascript;
44

55
use Drupal\Core\StringTranslation\StringTranslationTrait;
66
use Drupal\FunctionalJavascriptTests\JavascriptTestBase;

0 commit comments

Comments
 (0)