You are here

public function DeveloperSyncTest::testCliDeveloperSync in Apigee Edge 8

Tests the developer synchronization started from the CLI.

File

tests/src/Functional/DeveloperSyncTest.php, line 591

Class

DeveloperSyncTest
Developer-user synchronization test.

Namespace

Drupal\Tests\apigee_edge\Functional

Code

public function testCliDeveloperSync() {
  $cli_service = $this->container
    ->get('apigee_edge.cli');
  $input = new ArgvInput();
  $output = new BufferedOutput();
  $cli_service
    ->sync(new SymfonyStyle($input, $output), 't');
  $printed_output = $output
    ->fetch();
  foreach ($this->edgeDevelopers as $email => $developer) {
    $this
      ->assertStringContainsString("Copying developer ({$email}) from Apigee Edge.", $printed_output);
  }
  foreach ($this->drupalUsers as $email => $user) {
    $this
      ->assertStringContainsString("Copying user ({$email}) to Apigee Edge.", $printed_output);
  }
  foreach ($this->modifiedEdgeDevelopers as $email => $developer) {
    $this
      ->assertStringContainsString("Updating user ({$email}) from Apigee Edge.", $printed_output);
  }
  foreach ($this->modifiedDrupalUsers as $email => $user) {
    $this
      ->assertStringContainsString("Updating developer ({$email}) in Apigee Edge.", $printed_output);
  }
  $this
    ->verify();
}