You are here

public function LingotekTestCase::testProSetup in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 tests/lingotek.setup.test \LingotekTestCase::testProSetup()
  2. 7.4 tests/lingotek.setup.test \LingotekTestCase::testProSetup()
  3. 7.5 tests/lingotek.setup.test \LingotekTestCase::testProSetup()

File

tests/lingotek.setup.test, line 154
Lingotek Setup Test Case

Class

LingotekTestCase
@file Lingotek Setup Test Case

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>');

  //2: Enable Language Switcher
  $this
    ->drupalPost(NULL, array(), 'Next');
  $this
    ->assertText('The default language switcher is now enabled.', 'Step 2: Enable Language Switcher');

  //3: Content Types
  $this
    ->drupalPost(NULL, array(), 'Next');
  $this
    ->assertText('Your content types have been updated.', 'Step 3: Enable Content Types');

  //4: Comment Translation
  $this
    ->drupalPost(NULL, array(), 'Next');
  $this
    ->assertText('Your content types have been updated.', 'Step 4: Enable Comment Translation');

  //5: Additional Translation
  $this
    ->drupalPost(NULL, array(), 'Finish');
  $this
    ->assertText('The configuration options have been saved.', 'Step 5: Enable Additional Translation');
}