FootermapBlockWebTest.php in footermap: a footer site map 8
File
tests/src/Functional/FootermapBlockWebTest.php
View source
<?php
namespace Drupal\Tests\footermap\Functional;
use Drupal\Tests\block\Functional\AssertBlockAppearsTrait;
use Drupal\Tests\BrowserTestBase;
class FootermapBlockWebTest extends BrowserTestBase {
use AssertBlockAppearsTrait;
protected $defaultTheme = 'stark';
protected static $modules = [
'block',
'menu_ui',
'path',
'footermap',
];
protected $block;
protected function setUp() {
parent::setUp();
$settings = [
'label' => 'Footermap',
'footermap_recurse_limit' => '0',
'footermap_display_heading' => '1',
'footermap_avail_menus' => [],
'footermap_top_menu' => '',
'region' => 'footer',
];
$this->block = $this
->drupalPlaceBlock('footermap_block', $settings);
}
public function testFrontPage() {
$this
->drupalGet('');
$this
->assertBlockAppears($this->block);
$this
->assertSession()
->pageTextContains('Footermap');
$this
->assertSession()
->statusCodeEquals(200);
}
}