FormModeManagerExamplesTest.php in Form mode manager 8
File
modules/form_mode_manager_examples/src/Tests/FormModeManagerExamplesTest.php
View source
<?php
namespace Drupal\form_mode_manager_examples\Tests;
use Drupal\Tests\BrowserTestBase;
class FormModeManagerExamplesTest extends BrowserTestBase {
public static $modules = [
'menu_ui',
'path',
'node',
'block',
'block_content',
];
public function setUp() {
parent::setUp();
\Drupal::service('theme_handler')
->install([
'bartik',
]);
$this
->config('system.theme')
->set('default', 'bartik')
->save();
$this
->assertTrue(\Drupal::service('module_installer')
->install([
'form_mode_manager_examples',
]), 'form_mode_manager_examples installed.');
$this
->drupalPlaceBlock('local_actions_block');
\Drupal::service('router.builder')
->rebuild();
}
public function testInstalled() {
$this
->drupalGet('');
$this
->assertSession()
->titleEquals('Form Mode Manager examples | Drupal');
$this
->assertSession()
->pageTextContains('Form Mode Manager examples');
$this
->assertSession()
->pageTextContains('Welcome to Form Mode Manager example.');
$this
->assertSession()
->pageTextContains('Form Mode Manager allows to use form_mode implement on Drupal 8 on each Entity.');
$this
->assertSession()
->pageTextContains('You can test the functionality with custom content types created for the demonstration of features Form Mode Manager examples:');
$this
->drupalLogin($this->rootUser);
$this
->drupalGet('');
$this
->assertSession()
->linkExists('Add node as Contributor');
}
}