/**
  * Assert that there is no integration's been saved message.
  *
  * @param IntegrationIndex $integrationIndex
  * @return void
  */
 public function processAssert(IntegrationIndex $integrationIndex)
 {
     $noSuccessMessage = false;
     if ($integrationIndex->getMessagesBlock()->isVisible()) {
         try {
             $integrationIndex->getMessagesBlock()->getSuccessMessages();
         } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) {
             $noSuccessMessage = true;
         }
     } else {
         $noSuccessMessage = true;
     }
     \PHPUnit_Framework_Assert::assertTrue($noSuccessMessage, 'Integration is not saved.');
 }
 /**
  * Assert that success save message is appeared on the Integrations page
  *
  * @param IntegrationIndex $integrationIndexPage
  * @param Integration $integration
  * @param Integration|null $initialIntegration
  * @return void
  */
 public function processAssert(IntegrationIndex $integrationIndexPage, Integration $integration, Integration $initialIntegration = null)
 {
     $name = $initialIntegration !== null && !$integration->hasData('name') ? $initialIntegration->getName() : $integration->getName();
     $expectedMessage = sprintf(self::SUCCESS_SAVE_MESSAGE, $name);
     $actualMessage = $integrationIndexPage->getMessagesBlock()->getSuccessMessage();
     \PHPUnit_Framework_Assert::assertEquals($expectedMessage, $actualMessage, 'Wrong success message is displayed.' . "\nExpected: " . $expectedMessage . "\nActual: " . $actualMessage);
 }
 /**
  * Assert that success delete message is appeared on the Integrations page
  *
  * @param IntegrationIndex $integrationIndexPage
  * @param Integration $integration
  * @return void
  */
 public function processAssert(IntegrationIndex $integrationIndexPage, Integration $integration)
 {
     $expectedMessage = sprintf(self::SUCCESS_DELETE_MESSAGE, $integration->getName());
     $actualMessage = $integrationIndexPage->getMessagesBlock()->getSuccessMessages();
     \PHPUnit_Framework_Assert::assertEquals($expectedMessage, $actualMessage, 'Wrong success message is displayed.' . "\nExpected: " . $expectedMessage . "\nActual: " . $actualMessage);
 }
 /**
  * Assert that success reauthorize message is appeared on the Integrations page.
  *
  * @param IntegrationIndex $integrationIndexPage
  * @param Integration $integration
  * @return void
  */
 public function processAssert(IntegrationIndex $integrationIndexPage, Integration $integration)
 {
     \PHPUnit_Framework_Assert::assertEquals(sprintf(self::SUCCESS_REAUTHORIZE_MESSAGE, $integration->getName()), $integrationIndexPage->getMessagesBlock()->getSuccessMessage(), "Wrong success message is displayed.");
 }
 /**
  * Assert error message is displayed in message block.
  *
  * @param IntegrationIndex $integrationIndexPage
  * @param Integration $integration
  * @return void
  */
 public function processAssert(IntegrationIndex $integrationIndexPage, Integration $integration)
 {
     $expectedMessage = sprintf(self::ERROR_DUPLICATE_INTEGRATION_NAME, $integration->getName());
     $actualMessage = $integrationIndexPage->getMessagesBlock()->getErrorMessages();
     \PHPUnit_Framework_Assert::assertEquals($expectedMessage, $actualMessage, 'Wrong error message is displayed.' . "\nExpected: " . $expectedMessage . "\nActual: " . $actualMessage);
 }
 /**
  * Assert that an error message is displayed on the Integration page in case current user password is incorrect.
  *
  * @param IntegrationIndex $integrationIndexPage
  * @return void
  */
 public function processAssert(IntegrationIndex $integrationIndexPage)
 {
     $actualMessage = $integrationIndexPage->getMessagesBlock()->getErrorMessage();
     \PHPUnit_Framework_Assert::assertEquals(self::ERROR_MESSAGE, $actualMessage, 'Wrong error message is displayed.' . "\nExpected: " . self::ERROR_MESSAGE . "\nActual: " . $actualMessage);
 }