Skip to content

Commit af754cf

Browse files
ACMS-4504: Remove the unused code from all tests.
1 parent e49b56d commit af754cf

9 files changed

+7
-117
lines changed

modules/acquia_cms_headless/tests/src/Functional/DashboardApiUsersTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testSection(): void {
5959
$this->assertButtonLink($usersFieldset, '/admin/people/create?destination=/admin/headless/dashboard');
6060

6161
// Test table body exists and has data in the same order.
62-
$this->assertEquals('Headless', $this->getTableBodyColumn(0,1)->getText());
62+
$this->assertEquals('Headless', $this->getTableBodyColumn(0, 1)->getText());
6363
$this->assertEquals('Headless Administrator', $this->getTableBodyColumn(1)->getText());
6464

6565
// Get the API Users operations dropdown elements.

modules/acquia_cms_headless/tests/src/Functional/HeadlessContentTest.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,6 @@ class HeadlessContentTest extends WebDriverTestBase {
3030
'media_library',
3131
];
3232

33-
/**
34-
* Disable strict config schema checks in this test.
35-
*
36-
* Scheduler has a config schema errors, and until it's fixed,
37-
* this test cannot pass unless we disable strict config schema checking
38-
* altogether. Since strict config schema isn't critically important in
39-
* testing this functionality, it's okay to disable it for now, but it should
40-
* be re-enabled (i.e., this property should be removed) as soon as possible.
41-
*
42-
* @var bool
43-
*/
44-
// @codingStandardsIgnoreStart
45-
protected $strictConfigSchema = FALSE;
46-
// @codingStandardsIgnoreEnd
47-
4833
/**
4934
* {@inheritdoc}
5035
*/
@@ -118,8 +103,6 @@ public function testContentAdmin(): void {
118103
/** @var \Drupal\FunctionalJavascriptTests\JSWebAssert $assertSession */
119104
$assertSession = $this->assertSession();
120105
$assertSession->pageTextContains('Headless Test Page');
121-
// @todo Below commented test is failing in 3.0-rc8 version of Gin theme.
122-
// However this was working in 3.0-rc5 will be fixed in ACMS-3456.
123106
$assertSession->linkNotExists('View');
124107
$nodePageMenus = [
125108
'API' => '/jsonapi/node/test/' . $node->uuid(),

modules/acquia_cms_headless/tests/src/Functional/HeadlessDrushCommandsTest.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,6 @@ class HeadlessDrushCommandsTest extends BrowserTestBase {
2929
*/
3030
protected $defaultTheme = 'stark';
3131

32-
/**
33-
* Disable strict config schema checks in this test.
34-
*
35-
* Scheduler has a config schema errors, and until it's fixed,
36-
* this test cannot pass unless we disable strict config schema checking
37-
* altogether. Since strict config schema isn't critically important in
38-
* testing this functionality, it's okay to disable it for now, but it should
39-
* be re-enabled (i.e., this property should be removed) as soon as possible.
40-
*
41-
* @var bool
42-
*/
43-
// @codingStandardsIgnoreStart
44-
protected $strictConfigSchema = FALSE;
45-
// @codingStandardsIgnoreEnd
46-
4732
/**
4833
* {@inheritdoc}
4934
*/

modules/acquia_cms_headless/tests/src/Functional/HeadlessFrontpageTest.php

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Drupal\Tests\acquia_cms_headless\Functional;
44

55
use Drupal\Tests\BrowserTestBase;
6-
use Drupal\user\Entity\Role;
76

87
/**
98
* Tests for acquia_cms_headless frontpage.
@@ -23,25 +22,9 @@ class HeadlessFrontpageTest extends BrowserTestBase {
2322
*/
2423
protected static $modules = [
2524
'acquia_cms_headless_ui',
26-
'node',
2725
'views',
2826
];
2927

30-
/**
31-
* Disable strict config schema checks in this test.
32-
*
33-
* Scheduler has a config schema errors, and until it's fixed,
34-
* this test cannot pass unless we disable strict config schema checking
35-
* altogether. Since strict config schema isn't critically important in
36-
* testing this functionality, it's okay to disable it for now, but it should
37-
* be re-enabled (i.e., this property should be removed) as soon as possible.
38-
*
39-
* @var bool
40-
*/
41-
// @codingStandardsIgnoreStart
42-
protected $strictConfigSchema = FALSE;
43-
// @codingStandardsIgnoreEnd
44-
4528
/**
4629
* Assert that frontpage for non logged-in user is login page.
4730
*/
@@ -56,15 +39,6 @@ public function testFrontPageIsLoginPage(): void {
5639
*/
5740
public function testFrontPageIsAdminContentPage(): void {
5841
$account = $this->createUser();
59-
// Ensure the administrator role exists,
60-
// required for local environment tests with ddev.
61-
if (!Role::load('administrator')) {
62-
Role::create([
63-
'id' => 'administrator',
64-
'label' => 'Administrator',
65-
'is_admin' => TRUE,
66-
])->save();
67-
}
6842
$account->addRole('administrator');
6943
$account->save();
7044
// Don't use one-time login links instead submit the login form.

modules/acquia_cms_headless/tests/src/Functional/HeadlessModeEnablementTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Drupal\Tests\acquia_cms_headless\Functional;
44

55
use Drupal\Core\Extension\Exception\UnknownExtensionException;
6-
use Drupal\user\Entity\Role;
76

87
/**
98
* Tests for acquia_cms_headless Hybrid mode.

modules/acquia_cms_headless/tests/src/Functional/HeadlessSubrequestsTest.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,6 @@ class HeadlessSubrequestsTest extends BrowserTestBase {
2525
'acquia_cms_headless',
2626
];
2727

28-
/**
29-
* Disable strict config schema checks in this test.
30-
*
31-
* Scheduler has a config schema errors, and until it's fixed,
32-
* this test cannot pass unless we disable strict config schema checking
33-
* altogether. Since strict config schema isn't critically important in
34-
* testing this functionality, it's okay to disable it for now, but it should
35-
* be re-enabled (i.e., this property should be removed) as soon as possible.
36-
*
37-
* @var bool
38-
*/
39-
// @codingStandardsIgnoreStart
40-
protected $strictConfigSchema = FALSE;
41-
// @codingStandardsIgnoreEnd
42-
4328
/**
4429
* {@inheritdoc}
4530
*/

modules/acquia_cms_headless/tests/src/Functional/HeadlessTestBase.php

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Acquia\DrupalEnvironmentDetector\AcquiaDrupalEnvironmentDetector;
66
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
7-
use Drupal\user\Entity\Role;
87

98
/**
109
* Base class for the HeadlessDashboard web_driver tests.
@@ -22,23 +21,9 @@ abstract class HeadlessTestBase extends WebDriverTestBase {
2221
protected static $modules = [
2322
'acquia_cms_headless',
2423
'entity_clone',
24+
'views'
2525
];
2626

27-
/**
28-
* Disable strict config schema checks in this test.
29-
*
30-
* Scheduler has a config schema errors, and until it's fixed,
31-
* this test cannot pass unless we disable strict config schema checking
32-
* altogether. Since strict config schema isn't critically important in
33-
* testing this functionality, it's okay to disable it for now, but it should
34-
* be re-enabled (i.e., this property should be removed) as soon as possible.
35-
*
36-
* @var bool
37-
*/
38-
// @codingStandardsIgnoreStart
39-
protected $strictConfigSchema = FALSE;
40-
// @codingStandardsIgnoreEnd
41-
4227
/**
4328
* {@inheritdoc}
4429
*/
@@ -54,6 +39,10 @@ protected function setUp(): void {
5439
$account->save();
5540
$this->drupalLogin($account);
5641

42+
// Place the tasks and page title blocks.
43+
$this->drupalPlaceBlock('local_tasks_block', ['id' => 'local-tasks', 'region' => 'content', 'theme' => 'stark']);
44+
$this->drupalPlaceBlock('page_title_block', ['id' => 'page-title', 'region' => 'content', 'theme' => 'stark']);
45+
5746
// Visit headless dashboard.
5847
$this->drupalGet("/admin/headless/dashboard");
5948
}

modules/acquia_cms_headless/tests/src/Functional/PureHeadlessModeMenuTest.php

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Drupal\Core\Extension\Exception\UnknownExtensionException;
88
use Drupal\Core\Extension\ModuleExtensionList;
99
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
10-
use Drupal\user\Entity\Role;
1110

1211
/**
1312
* Pure headless mode menu tests.
@@ -31,26 +30,12 @@ class PureHeadlessModeMenuTest extends WebDriverTestBase {
3130
*/
3231
protected static $modules = [
3332
'acquia_cms_headless_ui',
33+
'acquia_cms_toolbar',
3434
'block_content',
3535
'media_library',
3636
'menu_ui',
3737
];
3838

39-
/**
40-
* Disable strict config schema checks in this test.
41-
*
42-
* Scheduler has a config schema errors, and until it's fixed,
43-
* this test cannot pass unless we disable strict config schema checking
44-
* altogether. Since strict config schema isn't critically important in
45-
* testing this functionality, it's okay to disable it for now, but it should
46-
* be re-enabled (i.e., this property should be removed) as soon as possible.
47-
*
48-
* @var bool
49-
*/
50-
// @codingStandardsIgnoreStart
51-
protected $strictConfigSchema = FALSE;
52-
// @codingStandardsIgnoreEnd
53-
5439
/**
5540
* The module installer object.
5641
*
@@ -78,15 +63,6 @@ protected function setUp(): void {
7863
$this->moduleInstaller = $this->container->get('module_installer');
7964
$this->moduleList = $this->container->get('extension.list.module');
8065
$account = $this->drupalCreateUser();
81-
// Ensure the administrator role exists,
82-
// required for local environment tests with ddev.
83-
if (!Role::load('administrator')) {
84-
Role::create([
85-
'id' => 'administrator',
86-
'label' => 'Administrator',
87-
'is_admin' => TRUE,
88-
])->save();
89-
}
9066
$account->addRole('administrator');
9167
$account->save();
9268
$this->drupalLogin($account);

modules/acquia_cms_headless/tests/src/Traits/DashboardSectionTrait.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Drupal\Tests\acquia_cms_headless\Traits;
44

55
use Behat\Mink\Element\NodeElement;
6-
use Drupal\user\Entity\Role;
76

87
/**
98
* Trait to test dashboard section.

0 commit comments

Comments
 (0)