Mercurial > hg > isophonics-drupal-site
view core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php @ 18:af1871eacc83
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:33:08 +0100 |
parents | 4c8ae668cc8c |
children |
line wrap: on
line source
<?php namespace Drupal\Tests\config\Functional; use Drupal\Tests\BrowserTestBase; /** * Tests configuration entity status UI functionality. * * @group config */ class ConfigEntityStatusUITest extends BrowserTestBase { /** * Modules to enable. * * @var array */ public static $modules = ['config_test']; /** * Tests status operations. */ public function testCRUD() { $this->drupalLogin($this->drupalCreateUser(['administer site configuration'])); $id = strtolower($this->randomMachineName()); $edit = [ 'id' => $id, 'label' => $this->randomMachineName(), ]; $this->drupalPostForm('admin/structure/config_test/add', $edit, 'Save'); $entity = \Drupal::entityTypeManager()->getStorage('config_test')->load($id); // Disable an entity. $disable_url = $entity->toUrl('disable'); $this->assertLinkByHref($disable_url->toString()); $this->drupalGet($disable_url); $this->assertResponse(200); $this->assertNoLinkByHref($disable_url->toString()); // Enable an entity. $enable_url = $entity->toUrl('enable'); $this->assertLinkByHref($enable_url->toString()); $this->drupalGet($enable_url); $this->assertResponse(200); $this->assertNoLinkByHref($enable_url->toString()); } }