/** * Assert that gift registry data on edit page equals passed from fixture. * * @param GiftRegistryIndex $giftRegistryIndex * @param GiftRegistryEdit $giftRegistryEdit * @param GiftRegistry $giftRegistry * @return void */ public function processAssert(GiftRegistryIndex $giftRegistryIndex, GiftRegistryEdit $giftRegistryEdit, GiftRegistry $giftRegistry) { $giftRegistryIndex->open(); $fixtureData = $giftRegistry->getData(); $giftRegistryIndex->getGiftRegistryList()->eventAction($fixtureData['title'], 'Edit'); $formData = $giftRegistryEdit->getGiftRegistryEditForm()->getData(); $errors = $this->verifyData($fixtureData, $formData); \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); }
/** * Create gift registry entity test. * * @param GiftRegistry $giftRegistry * @param Customer $customer * @return void */ public function test(GiftRegistry $giftRegistry, Customer $customer) { // Steps $this->objectManager->create('Mage\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run(); $this->customerAccountIndex->getAccountNavigationBlock()->openNavigationItem("Gift Registry"); $this->giftRegistryIndex->getGiftRegistryList()->addNew(); $this->giftRegistryAddSelect->getGiftRegistryEditForm()->selectGiftRegistryType($giftRegistry->getTypeId()); $this->giftRegistryEdit->getGiftRegistryEditForm()->fill($giftRegistry); $this->giftRegistryEdit->getGiftRegistryEditForm()->save(); }