ConfigEntityStatusUITest.php in Zircon Profile 8
File
core/modules/config/src/Tests/ConfigEntityStatusUITest.php
View source
<?php
namespace Drupal\config\Tests;
use Drupal\simpletest\WebTestBase;
class ConfigEntityStatusUITest extends WebTestBase {
public static $modules = array(
'config_test',
);
function testCRUD() {
$this
->drupalLogin($this
->drupalCreateUser([
'administer site configuration',
]));
$id = strtolower($this
->randomMachineName());
$edit = array(
'id' => $id,
'label' => $this
->randomMachineName(),
);
$this
->drupalPostForm('admin/structure/config_test/add', $edit, 'Save');
$entity = entity_load('config_test', $id);
$disable_url = $entity
->urlInfo('disable');
$this
->assertLinkByHref($disable_url
->toString());
$this
->drupalGet($disable_url);
$this
->assertResponse(200);
$this
->assertNoLinkByHref($disable_url
->toString());
$enable_url = $entity
->urlInfo('enable');
$this
->assertLinkByHref($enable_url
->toString());
$this
->drupalGet($enable_url);
$this
->assertResponse(200);
$this
->assertNoLinkByHref($enable_url
->toString());
}
}