class StreamWrapperExampleTest
Functional tests for the stream wrapper example.
@group stream_wrapper_example @group examples
Hierarchy
- class \Drupal\Tests\examples\Functional\ExamplesBrowserTestBase extends \Drupal\Tests\BrowserTestBase
- class \Drupal\Tests\stream_wrapper_example\Functional\StreamWrapperExampleTest extends \Drupal\Tests\examples\Functional\ExamplesBrowserTestBase
Expanded class hierarchy of StreamWrapperExampleTest
Related topics
File
-
modules/
stream_wrapper_example/ tests/ src/ Functional/ StreamWrapperExampleTest.php, line 16
Namespace
Drupal\Tests\stream_wrapper_example\FunctionalView source
class StreamWrapperExampleTest extends ExamplesBrowserTestBase {
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected static $modules = [
'stream_wrapper_example',
];
/**
* Make sure all the public routes behave the way they should.
*/
public function testRoutes() {
$assert = $this->assertSession();
$this->drupalLogin($this->createUser([
'access content',
]));
$links = [
'' => Url::fromRoute('stream_wrapper_example.description'),
];
// Check for the toolbar links.
foreach ($links as $page => $path) {
$this->drupalGet($page);
$assert->linkByHrefExists($path->getInternalPath());
}
// Visit each route.
foreach ($links as $path) {
$this->drupalGet($path);
$assert->statusCodeEquals(200);
}
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
|---|---|---|---|---|---|
| ExamplesBrowserTestBase::setUp | protected | function | 5 | ||
| ExamplesBrowserTestBase::setupExamplesMenus | protected | function | Set up menus and tasks in their regions. | ||
| StreamWrapperExampleTest::$defaultTheme | protected | property | |||
| StreamWrapperExampleTest::$modules | protected static | property | Modules to install. | Overrides ExamplesBrowserTestBase::$modules | |
| StreamWrapperExampleTest::testRoutes | public | function | Make sure all the public routes behave the way they should. |