public function LingotekTestCase::testProSetup in Lingotek Translation 7.4
Same name and namespace in other branches
- 7.7 tests/lingotek.setup.test \LingotekTestCase::testProSetup()
- 7.5 tests/lingotek.setup.test \LingotekTestCase::testProSetup()
- 7.6 tests/lingotek.setup.test \LingotekTestCase::testProSetup()
File
- tests/
lingotek.setup.test, line 128
Class
Code
public function testProSetup() {
debug('Beginning Pro Setup');
$this
->drupalGet('admin/config/lingotek/setup');
$this
->assertResponse(403, 'Only allow access to users with permissions');
$this
->drupalLogin($this->admin_user);
$this
->drupalGet('admin/config/lingotek/setup');
$this
->assertUrl('admin/config/lingotek/new-account', array(), 'Redirect to first step of start page');
//1: Account Settings
$settings = array(
'first_name' => 'Automated Tester',
'last_name' => 'Code Tester',
'email' => 'test@example.com',
);
debug($settings);
$this
->drupalPost(NULL, $settings, 'Next');
$this
->assertText('Your new Lingotek account has been setup.', '<b>Step 1: Account Settings - Abililty to create account</b>');
$this
->assertText('Source language', '<b>Step 1: Account Settings - Redirect to next page</b>');
//3: Source Language
$this
->drupalPost(NULL, array(), 'Next');
$this
->assertText('Your language settings have been saved.', 'Step 3: Source Language');
//4: Default Language Switcher
$this
->drupalPost(NULL, array(), 'Next');
$this
->assertText('The default language switcher is now enabled.', 'Step 4: Default Language Switcher');
//5: Content
$settings = array(
'lingotek_nodes_translation_method' => 'field',
);
$this
->drupalPost(NULL, $settings, 'Next');
$this
->assertText('Your content types have been updated.', 'Step 5: Content');
$this
->assertText('Which comment items do you want translated?', 'Step 5: Content - Redirect to next page');
//6: Comments
$this
->drupalPost(NULL, array(), 'Next');
$this
->assertText('The configuration options have been saved.', 'Step 6: Comments');
$this
->assertText('Configuration Translation', 'Step 6: Comments - Redirect to next page');
//7: Config + Bulk Operations
$this
->drupalPost(NULL, array(), 'Finish');
$this
->assertText('The configuration options have been saved.', 'Step 7: Config + Bulk Operations');
}