Skip to content

Commit

Permalink
Adjust home page test
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Oct 20, 2023
1 parent 2c65315 commit 553dce5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/codeception/functional/Users/RolesCest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use Faker\Factory;

/**
* Class RolesCest.
*
Expand Down Expand Up @@ -34,6 +36,11 @@ public function _after(FunctionalTester $I) {
foreach ($this->state as $key => $value) {
\Drupal::state()->set($key, $value);
}
drupal_flush_all_caches();
}

public function __construct() {
$this->faker = Factory::create();
}

/**
Expand All @@ -52,11 +59,11 @@ protected function saveStateValue($key) {
public function testBulkDeleteHomePage(FunctionalTester $I) {
$test_home = $I->createEntity([
'type' => 'stanford_page',
'title' => 'Foo Bar Home',
'title' => $this->faker->words(3, true),
]);
$I->createEntity([
'type' => 'stanford_page',
'title' => 'Another Page',
'title' => $this->faker->words(3, true),
]);
$test_home_url = $test_home->toUrl()->toString();
\Drupal::state()->set('stanford_profile.front_page', $test_home_url);
Expand All @@ -74,7 +81,7 @@ public function testBulkDeleteHomePage(FunctionalTester $I) {
$I->canSee('Access denied (1)');
$I->runDrush('cache-rebuild');
$I->amOnPage('/');
$I->canSee('Foo Bar Home', 'h1');
$I->canSee($test_home->label(), 'h1');
}

/**
Expand Down

0 comments on commit 553dce5

Please sign in to comment.