/** * Assert that displayed gift card account data on edit page equals passed from fixture. * * @param GiftCardAccount $giftCardAccount * @param GiftCardAccountNew $giftCardAccountNew * @param GiftCardAccountIndex $giftCardAccountIndex * @param string $code * @return void */ public function processAssert(GiftCardAccount $giftCardAccount, GiftCardAccountNew $giftCardAccountNew, GiftCardAccountIndex $giftCardAccountIndex, $code) { $giftCardAccountIndex->open(); $giftCardAccountIndex->getGiftCardAccountGrid()->searchAndOpen(['code' => $code], false); $formData = $giftCardAccountNew->getGiftCardAccountForm()->getData(); $dataDiff = $this->verifyData($giftCardAccount->getData(), $formData); \PHPUnit_Framework_Assert::assertEmpty($dataDiff, "Gift card account form data does not equal to passed from fixture. \n" . $dataDiff); }
/** * Create gift card account. * * @param GiftCardAccount $giftCardAccount * @return array */ public function test(GiftCardAccount $giftCardAccount) { // Steps $this->giftCardAccountIndex->open(); $this->giftCardAccountIndex->getMessagesBlock()->clickLinkInMessages('error', 'here'); $this->giftCardAccountIndex->getGridPageActions()->addNew(); $this->giftCardAccountNew->getGiftCardAccountForm()->fill($giftCardAccount); $this->giftCardAccountNew->getFormPageActions()->save(); $code = $this->giftCardAccountIndex->getGiftCardAccountGrid()->getCode(['balance' => $giftCardAccount->getBalance()], false); return ['code' => $code]; }