CshsTest.php in Client-side Hierarchical Select 8.2
File
tests/src/Functional/CshsTest.php
View source
<?php
namespace Drupal\Tests\cshs\Functional;
use Drupal\node\NodeInterface;
use Drupal\Tests\BrowserTestBase;
class CshsTest extends BrowserTestBase {
protected $defaultTheme = 'stable';
protected static $modules = [
'cshs',
'cshs_test',
'taxonomy',
'user',
'node',
'views',
];
public function testCshsViews() : void {
$user = $this
->drupalCreateUser([
'access content',
]);
$ct = $this
->drupalCreateContentType([
'type' => 'page',
'name' => 'Basic page',
]);
$this
->drupalCreateNode([
'uid' => $user
->id(),
'type' => $ct
->id(),
'status' => NodeInterface::PUBLISHED,
]);
$this
->drupalLogin($user);
$this
->drupalGet('cshs');
$assert = $this
->assertSession();
$assert
->statusCodeEquals(200);
$assert
->pageTextContains('CSHS view');
$assert
->elementExists('css', '#edit-tid');
$assert
->pageTextContains('Term ID');
$assert
->elementExists('css', '#edit-tid-depth');
$assert
->pageTextContains('Term ID (Depth)');
}
}