diff --git a/tests/src/Functional/ContentAccessAclTest.php b/tests/src/Functional/ContentAccessAclTest.php index abf73e2..080ffb8 100644 --- a/tests/src/Functional/ContentAccessAclTest.php +++ b/tests/src/Functional/ContentAccessAclTest.php @@ -61,10 +61,10 @@ class ContentAccessAclTest extends BrowserTestBase { protected function setUp() { parent::setUp(); - if (!\Drupal::moduleHandler()->moduleExists('acl')) { - $this->pass('No ACL module present, skipping test'); - return; - } + $this->assertTrue( + \Drupal::moduleHandler()->moduleExists('acl'), + 'No ACL module present, skipping test' + ); // Create test user with separate role. $this->testUser = $this->drupalCreateUser(); @@ -105,10 +105,10 @@ class ContentAccessAclTest extends BrowserTestBase { */ public function testViewAccess() { // Exit test if ACL module could not be enabled. - if (!\Drupal::moduleHandler()->moduleExists('acl')) { - $this->pass('No ACL module present, skipping test'); - return; - } + $this->assertTrue( + \Drupal::moduleHandler()->moduleExists('acl'), + 'No ACL module present, skipping test' + ); // Restrict access to this content type. // Enable per node access control. @@ -156,10 +156,10 @@ class ContentAccessAclTest extends BrowserTestBase { */ public function testEditAccess() { // Exit test if ACL module could not be enabled. - if (!\Drupal::moduleHandler()->moduleExists('acl')) { - $this->pass('No ACL module present, skipping test'); - return; - } + $this->assertTrue( + \Drupal::moduleHandler()->moduleExists('acl'), + 'No ACL module present, skipping test' + ); // Enable per node access control. $this->changeAccessPerNode(); @@ -201,10 +201,10 @@ class ContentAccessAclTest extends BrowserTestBase { */ public function testDeleteAccess() { // Exit test if ACL module could not be enabled. - if (!\Drupal::moduleHandler()->moduleExists('acl')) { - $this->pass('No ACL module present, skipping test'); - return; - } + $this->assertTrue( + \Drupal::moduleHandler()->moduleExists('acl'), + 'No ACL module present, skipping test' + ); // Enable per node access control. $this->changeAccessPerNode(); diff --git a/tests/src/Functional/ContentAccessTinyTest.php b/tests/src/Functional/ContentAccessTinyTest.php index 0ed48d1..ea649b9 100644 --- a/tests/src/Functional/ContentAccessTinyTest.php +++ b/tests/src/Functional/ContentAccessTinyTest.php @@ -61,10 +61,10 @@ class ContentAccessTinyTest extends BrowserTestBase { protected function setUp() { parent::setUp(); - if (!\Drupal::moduleHandler()->moduleExists('acl')) { - $this->pass('No ACL module present, skipping test'); - return; - } + $this->assertTrue( + \Drupal::moduleHandler()->moduleExists('acl'), + 'No ACL module present, skipping test' + ); // Create test user with separate role. $this->testUser = $this->drupalCreateUser(); @@ -105,10 +105,10 @@ class ContentAccessTinyTest extends BrowserTestBase { */ public function testViewAccess() { // Exit test if ACL module could not be enabled. - if (!\Drupal::moduleHandler()->moduleExists('acl')) { - $this->pass('No ACL module present, skipping test'); - return; - } + $this->assertTrue( + \Drupal::moduleHandler()->moduleExists('acl'), + 'No ACL module present, skipping test' + ); // Restrict access to this content type. // Enable per node access control. @@ -157,10 +157,10 @@ class ContentAccessTinyTest extends BrowserTestBase { /* public function testEditAccess() { // Exit test if ACL module could not be enabled. - if (!\Drupal::moduleHandler()->moduleExists('acl')) { - $this->pass('No ACL module present, skipping test'); - return; - } + $this->assertTrue( + \Drupal::moduleHandler()->moduleExists('acl'), + 'No ACL module present, skipping test' + ); // Enable per node access control. $this->changeAccessPerNode(); @@ -205,10 +205,10 @@ class ContentAccessTinyTest extends BrowserTestBase { /* public function testDeleteAccess() { // Exit test if ACL module could not be enabled. - if (!\Drupal::moduleHandler()->moduleExists('acl')) { - $this->pass('No ACL module present, skipping test'); - return; - } + $this->assertTrue( + \Drupal::moduleHandler()->moduleExists('acl'), + 'No ACL module present, skipping test' + ); // Enable per node access control. $this->changeAccessPerNode();