function RestExampleActionTest::setUp
Same name in other branches
- 4.0.x modules/rest_example/tests/src/Functional/RestExampleActionTest.php \Drupal\Tests\rest_example\Functional\RestExampleActionTest::setUp()
Throws
\Drupal\Core\Entity\EntityStorageException
Overrides BrowserTestBase::setUp
File
-
modules/
rest_example/ tests/ src/ Functional/ RestExampleActionTest.php, line 35
Class
- RestExampleActionTest
- Verify that the Views are accessible.
Namespace
Drupal\Tests\rest_example\FuntionalCode
protected function setUp() : void {
parent::setup();
global $base_url;
$account = $this->drupalCreateUser();
$this->drupalLogin($account);
$config_factory = \Drupal::configFactory();
$rest_config = $config_factory->getEditable('rest_example.settings');
$rest_config->set('server_url', $base_url)
->set('server_username', $account->get('name')->value)
->set('server_password', $account->passRaw)
->save();
}