AdminUiTest.php in New Relic 2.0.x
File
tests/src/Functional/AdminUiTest.php
View source
<?php
namespace Drupal\Tests\new_relic_rpm\Functional;
use Drupal\Tests\BrowserTestBase;
class AdminUiTest extends BrowserTestBase {
protected static $modules = [
'new_relic_rpm',
];
private $assert;
private $page;
protected function setUp() {
parent::setUp();
$admin = $this
->createUser([], NULL, TRUE);
$admin
->addRole('administrator');
$admin
->save();
$this
->drupalLogin($admin);
if (!isset($this->assert) || !isset($this->page)) {
$this->assert = $this
->assertSession();
$this->page = $this
->getSession()
->getPage();
}
}
public function testSettingsPage() {
$this
->drupalGet('/admin/config/development/new-relic');
$this->assert
->statusCodeEquals(200);
$this->page
->hasField('api_key');
$this->page
->hasField('track_drush');
$this->page
->hasField('track_cron');
$this->page
->hasField('ignore_roles[]');
$this->page
->hasField('ignore_urls');
$this->page
->hasField('bg_urls');
$this->page
->hasField('exclusive_urls');
$this->page
->hasField('watchdog_severities[]');
$this->page
->hasField('override_exception_handler');
$this->page
->hasField('module_deployment');
$this->page
->hasField('config_import');
$this->page
->hasField('views_log_slow');
$this->page
->hasField('views_log_threshold');
}
}