public function DevelContainerInfoTest::testServiceDetail in Devel 8
Same name and namespace in other branches
- 8.3 tests/src/Functional/DevelContainerInfoTest.php \Drupal\Tests\devel\Functional\DevelContainerInfoTest::testServiceDetail()
- 8.2 tests/src/Functional/DevelContainerInfoTest.php \Drupal\Tests\devel\Functional\DevelContainerInfoTest::testServiceDetail()
- 4.x tests/src/Functional/DevelContainerInfoTest.php \Drupal\Tests\devel\Functional\DevelContainerInfoTest::testServiceDetail()
Tests service detail page.
File
- tests/
src/ Functional/ DevelContainerInfoTest.php, line 140
Class
- DevelContainerInfoTest
- Tests container info pages and links.
Namespace
Drupal\Tests\devel\FunctionalCode
public function testServiceDetail() {
$service_id = 'devel.dumper';
// Ensures that the page works as expected.
$this
->drupalGet("/devel/container/service/{$service_id}");
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSession()
->pageTextContains("Service {$service_id} detail");
// Ensures that the page returns a 404 error if the requested service is
// not defined.
$this
->drupalGet('/devel/container/service/not.exists');
$this
->assertSession()
->statusCodeEquals(404);
// Ensures that the page is accessible ony to users with the adequate
// permissions.
$this
->drupalLogout();
$this
->drupalGet("devel/container/service/{$service_id}");
$this
->assertSession()
->statusCodeEquals(403);
}