public function OptimizelyTestDefaultProjectTestCase::testOptimizelyTestDefaultProjectEnable in Optimizely 7.2
Same name and namespace in other branches
- 7.3 optimizely.test \OptimizelyTestDefaultProjectTestCase::testOptimizelyTestDefaultProjectEnable()
File
- ./
optimizely.test, line 206 - Optimizely Tests
Class
- OptimizelyTestDefaultProjectTestCase
- OptimizelyTestDefaultProjectTestCase: Test that:
Code
public function testOptimizelyTestDefaultProjectEnable() {
// Access with privileged user
$this
->drupalLogin($this->privileged_user);
// Look for entry in project listing page
$this
->drupalGet('admin/config/system/optimizely');
$this
->assertRaw('<td class="project-title-column disabled">Default</td>', '** <strong>Default project entry fround on project listing page.</strong>');
// Confirm default project is not enabled
$this
->assertRaw('<input id="project-enable-1" name="project-1" type="checkbox" value="1" class="form-checkbox" />', '** <strong>Default project is not enabled.</strong>');
// Link to complete default project setup available
$this
->assertRaw('<strong><a href="/admin/config/system/optimizely/settings">Account Info</a></strong>', '** <strong>Link from default project to module settings page available.</strong>');
// Navigate to Edit form for Default project
$this
->drupalGet('admin/config/system/optimizely/add_update/1');
// Title field set to Default, not accessable
$this
->assertRaw('<input disabled="disabled" type="text" id="edit-optimizely-project-title" name="optimizely_project_title" value="Default"', '** <strong>Project title field is not editable and set to "Default"</strong>.');
// Project Code field not set (Undefined), not accessable
$this
->assertRaw('<input disabled="disabled" type="text" id="edit-optimizely-project-code" name="optimizely_project_code" value="Undefined"', '** <strong>Project code field is not editable and set to "Undefined".</strong>');
// Link to settings page to set account / Default project code
$this
->assertRaw('<a href="/admin/config/system/optimizely/settings">', '** <strong>Link to settings page found to set Default project code.</strong>');
// Check default Default project path is set to site wide wild card
$this
->assertRaw('name="optimizely_path" cols="100" rows="6" class="form-textarea">*</textarea>', '** <strong>Default project path set to site wide wild card "*".</strong>');
// * 5. The default project can not be enabled until the account number is entered on the settings page.
$this
->drupalLogout();
}