assertEmpty() public static method

Asserts that a variable is empty.
public static assertEmpty ( mixed $actual, string $message = '' )
$actual mixed
$message string
Example #1
0
 /**
  * Assert that data at the form corresponds to the fixture data
  *
  * @param SystemVariable $customVariable
  * @param SystemVariableIndex $systemVariableIndex
  * @param SystemVariableNew $systemVariableNew
  * @param Store $storeOrigin
  * @param SystemVariable $customVariableOrigin
  * @return void
  *
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 public function processAssert(SystemVariable $customVariable, SystemVariableIndex $systemVariableIndex, SystemVariableNew $systemVariableNew, Store $storeOrigin = null, SystemVariable $customVariableOrigin = null)
 {
     // Prepare data
     $data = $customVariableOrigin === null ? $customVariable->getData() : array_merge($customVariableOrigin->getData(), $customVariable->getData());
     if ($customVariableOrigin !== null) {
         $dataOrigin = $data;
         $dataOrigin['html_value'] = $customVariableOrigin->getHtmlValue();
         $dataOrigin['plain_value'] = $customVariableOrigin->getPlainValue();
     } else {
         $dataOrigin = $data;
     }
     if ($data['html_value'] == '') {
         $data['html_value'] = $customVariableOrigin->getHtmlValue();
         $data['use_default_value'] = 'Yes';
     }
     $data['plain_value'] = $data['plain_value'] == '' ? $customVariableOrigin->getPlainValue() : $data['plain_value'];
     // Perform assert
     $systemVariableIndex->open();
     $systemVariableIndex->getSystemVariableGrid()->searchAndOpen(['code' => $data['code']]);
     $formData = $systemVariableNew->getSystemVariableForm()->getData($customVariable);
     $errors = $this->verifyData($dataOrigin, $formData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
     if ($storeOrigin !== null) {
         $systemVariableNew->getFormPageActions()->selectStoreView($storeOrigin->getName());
         $formData = $systemVariableNew->getSystemVariableForm()->getData($customVariable);
         $errors = $this->verifyData($data, $formData);
         \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
     }
 }
 /**
  * @Then /^I should have the following history entries(| \(ignoring order\)):$/
  * @param TableNode $table
  */
 public function iShouldHaveTheFollowingHistoryEntries($ignoringOrder, TableNode $table)
 {
     $this->getSubcontext('flow')->persistAll();
     $allEvents = $this->getEventRepository()->findAll()->toArray();
     $eventsByInternalId = array();
     $unmatchedParentEvents = array();
     if ($ignoringOrder) {
         foreach ($table->getHash() as $i => $row) {
             foreach ($allEvents as $event) {
                 try {
                     $this->checkSingleEvent($row, $event, $eventsByInternalId, $unmatchedParentEvents);
                     // no exception thrown so far, so that means there is an $event which fits to the current expectation row $i. Thus, we continue in the next iteration.
                     continue 2;
                 } catch (PHPUnit_Framework_ExpectationFailedException $assertionFailed) {
                     // do nothing, we just retry the row on the next event.
                 }
             }
             // If we are that far, there was no match for the current row:
             Assert::fail('There was no match for row: ' . json_encode($row));
         }
     } else {
         foreach ($table->getHash() as $i => $row) {
             if (!isset($allEvents[$i])) {
                 Assert::fail(sprintf('Only %s events found, while the expected table contains %s events.', count($allEvents), count($table->getHash())));
             }
             $event = $allEvents[$i];
             $this->checkSingleEvent($row, $event, $eventsByInternalId, $unmatchedParentEvents);
         }
     }
     Assert::assertEquals(count($table->getHash()), count($allEvents), 'Number of expected events does not match total number of events.');
     Assert::assertEmpty($unmatchedParentEvents, 'Unmatched parent events found');
 }
 /**
  * Assert that displayed attribute data on edit page equals passed from fixture.
  *
  * @param CatalogProductAttributeIndex $catalogProductAttributeIndex
  * @param CatalogProductAttributeNew $catalogProductAttributeNew
  * @param CatalogProductAttribute $attribute
  * @throws \Exception
  * @return void
  */
 public function processAssert(CatalogProductAttributeIndex $catalogProductAttributeIndex, CatalogProductAttributeNew $catalogProductAttributeNew, CatalogProductAttribute $attribute)
 {
     $filter = ['attribute_code' => $attribute->getAttributeCode()];
     $catalogProductAttributeIndex->open()->getGrid()->searchAndOpen($filter);
     $errors = $this->verifyData($attribute->getData(), $catalogProductAttributeNew->getAttributeForm()->getData($attribute));
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
 public function testDeleteComposedTransaction()
 {
     $repository = app('App\\Repositories\\ComposedTransactionRepository');
     $request_id = 'reqid01';
     $transaction_hex = 'testhex01';
     $utxos = ['longtxid101:0', 'longtxid102:1'];
     $txid = 'txid01';
     $request_id_2 = 'reqid02';
     $transaction_hex_2 = 'testhex02';
     $utxos_2 = [201, 202];
     $txid_2 = 'txid02';
     $repository->storeComposedTransaction($request_id, $txid, $transaction_hex, $utxos);
     $repository->storeComposedTransaction($request_id_2, $txid_2, $transaction_hex_2, $utxos_2);
     // load the composed transaction
     $result = $repository->getComposedTransactionByRequestID($request_id);
     PHPUnit::assertEquals($transaction_hex, $result['transaction']);
     // delete the composed transaction
     $count = $repository->deleteComposedTransactionsByRequestID($request_id);
     PHPUnit::assertEquals(1, $count);
     // composed transaction one is deleted
     $result = $repository->getComposedTransactionByRequestID($request_id);
     PHPUnit::assertEmpty($result);
     // composed transaction two is good
     $result = $repository->getComposedTransactionByRequestID($request_id_2);
     PHPUnit::assertEquals($transaction_hex_2, $result['transaction']);
 }
 public function testUnconfirmingAnInvalidatedTransaction()
 {
     $provisional_tx_repository = app('App\\Repositories\\ProvisionalTransactionRepository');
     $notification_repository = app('App\\Repositories\\NotificationRepository');
     // setup monitors
     $address_helper = app('MonitoredAddressHelper');
     $monitor_1 = $address_helper->createSampleMonitoredAddress(null, ['address' => '1JztLWos5K7LsqW5E78EASgiVBaCe6f7cD']);
     // receive unconfirmed transactions
     $parsed_txs = $this->receiveUnconfirmedTransactions(1);
     // now confirm a malleated version of the transaction
     $malleated_tx = $parsed_txs[0];
     $malleated_tx['txid'] = str_repeat('0', 54) . 'MALLEATED1';
     $malleated_txs = [$malleated_tx];
     // now confirm the malleated transaction (with 2 confirmations)
     $this->sendConfirmationEvents(2, $malleated_txs);
     // check for invalidation notification
     $notification_models = $notification_repository->findByMonitoredAddressId($monitor_1['id'])->toArray();
     $invalidation_notification = array_slice($notification_models, -2, 1)[0];
     $invalidation_notification_details = $invalidation_notification['notification'];
     PHPUnit::assertEquals('invalidation', $invalidation_notification_details['event']);
     PHPUnit::assertEquals($parsed_txs[0]['txid'], $invalidation_notification_details['invalidTxid']);
     PHPUnit::assertEquals($malleated_txs[0]['txid'], $invalidation_notification_details['replacingTxid']);
     // check that the provisional transaction was removed
     $removed_tx = $provisional_tx_repository->findByTXID($parsed_txs[0]['txid']);
     PHPUnit::assertEmpty($removed_tx);
 }
 /**
  * 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);
 }
 /**
  * Assert that displayed segment data on edit page is equals passed from fixture.
  *
  * @param CustomerSegment $customerSegment
  * @param CustomerSegmentIndex $customerSegmentIndex
  * @param CustomerSegmentNew $customerSegmentNew
  * @return void
  */
 public function processAssert(CustomerSegment $customerSegment, CustomerSegmentIndex $customerSegmentIndex, CustomerSegmentNew $customerSegmentNew)
 {
     $customerSegmentIndex->open();
     $customerSegmentIndex->getGrid()->searchAndOpen(['grid_segment_name' => $customerSegment->getName()]);
     $formData = $customerSegmentNew->getCustomerSegmentForm()->getData();
     $dataDiff = $this->verifyData($customerSegment->getData(), $formData, false, false);
     \PHPUnit_Framework_Assert::assertEmpty($dataDiff, "Customer Segments data not equals to passed from fixture.\n Log:\n" . implode(";\n", $dataDiff));
 }
 /**
  * Assert product details.
  *
  * @param WishlistIndex $wishlistIndex
  * @param InjectableFixture $product
  * @param FixtureFactory $fixtureFactory
  * @return void
  */
 protected function assertProductDetails(WishlistIndex $wishlistIndex, InjectableFixture $product, FixtureFactory $fixtureFactory)
 {
     $actualOptions = $wishlistIndex->getItemsBlock()->getItemProduct($product)->getOptions();
     $cartFixture = $fixtureFactory->createByCode('cart', ['data' => ['items' => ['products' => [$product]]]]);
     $expectedOptions = $cartFixture->getItems()[0]->getData()['options'];
     $errors = $this->verifyData($this->sortDataByPath($expectedOptions, '::title'), $this->sortDataByPath($actualOptions, '::title'));
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
Example #9
0
 /**
  * Assert that displayed CMS page data on edit page equals passed from fixture.
  *
  * @param CmsPage $cms
  * @param CmsPageIndex $cmsPageIndex
  * @param CmsPageNew $cmsPageNew
  * @return void
  */
 public function processAssert(CmsPage $cms, CmsPageIndex $cmsPageIndex, CmsPageNew $cmsPageNew)
 {
     $cmsPageIndex->open();
     $cmsPageIndex->getCmsPageGridBlock()->searchAndOpen(['title' => $cms->getTitle()]);
     $cmsFormData = $cmsPageNew->getPageForm()->getData($cms);
     $errors = $this->verifyData($cms->getData(), $cmsFormData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
 /**
  * Assert that gift registry type form data is equal to fixture data.
  *
  * @param GiftRegistryType $giftRegistryType
  * @param BackendGiftRegistryIndex $giftRegistryIndex
  * @param GiftRegistryNew $giftRegistryNew
  * @return void
  */
 public function processAssert(GiftRegistryType $giftRegistryType, BackendGiftRegistryIndex $giftRegistryIndex, GiftRegistryNew $giftRegistryNew)
 {
     $giftRegistryIndex->getGiftRegistryGrid()->searchAndOpen(['label' => $giftRegistryType->getLabel()]);
     $formData = $giftRegistryNew->getGiftRegistryForm()->getData($giftRegistryType);
     $fixtureData = $giftRegistryType->getData();
     $errors = $this->verifyData($fixtureData, $formData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
Example #11
0
 /**
  * Assert that tax rate form filled correctly.
  *
  * @param TaxRateIndex $taxRateIndex
  * @param TaxRateNew $taxRateNew
  * @param TaxRate $taxRate
  * @return void
  */
 public function processAssert(TaxRateIndex $taxRateIndex, TaxRateNew $taxRateNew, TaxRate $taxRate)
 {
     $data = $this->prepareData($taxRate->getData());
     $taxRateIndex->open()->getTaxRatesGrid()->searchAndOpen(['code' => $data['code']]);
     $formData = $taxRateNew->getTaxRateForm()->getData($taxRate);
     $errors = $this->verifyData($data, $formData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
 /**
  * Assert that pop-up with resources, that were specified for integration are shown
  * after starting activation of integration
  *
  * @param IntegrationIndex $integrationIndex
  * @param Integration $integration
  * @return void
  */
 public function processAssert(IntegrationIndex $integrationIndex, Integration $integration)
 {
     $fixtureResources = is_array($integration->getResources()) ? $integration->getResources() : [$integration->getResources()];
     $formResources = $integrationIndex->getIntegrationGrid()->getResourcesPopup()->getData();
     $result = $this->verifyResources($formResources['resources'], $fixtureResources);
     \PHPUnit_Framework_Assert::assertEmpty($result, "Integration resources is not correct.\nLog:\n" . $result);
     $integrationIndex->getIntegrationGrid()->getResourcesPopup()->clickAllowButton();
 }
 /**
  * Assert that Search Term Report form data equals to passed from dataSet
  *
  * @param CatalogSearchEdit $catalogSearchEdit
  * @param SearchIndex $searchIndex
  * @param string $productName
  * @param int $countProducts
  * @param int $countSearch
  * @return void
  */
 public function processAssert(CatalogSearchEdit $catalogSearchEdit, SearchIndex $searchIndex, $productName, $countProducts, $countSearch)
 {
     $filter = ['query_text' => $productName, 'num_results' => $countProducts, 'popularity' => $countSearch];
     $searchIndex->open();
     $searchIndex->getSearchGrid()->searchAndOpen($filter);
     $dataDiff = $this->verifyData($filter, $catalogSearchEdit->getForm()->getData());
     \PHPUnit_Framework_Assert::assertEmpty($dataDiff, $dataDiff);
 }
 /**
  * Assert that displayed Store Group data on edit page equals passed from fixture
  *
  * @param StoreIndex $storeIndex
  * @param EditGroup $editGroup
  * @param StoreGroup $storeGroup
  * @param StoreGroup $storeGroupOrigin [optional]
  * @return void
  */
 public function processAssert(StoreIndex $storeIndex, EditGroup $editGroup, StoreGroup $storeGroup, StoreGroup $storeGroupOrigin = null)
 {
     $fixtureData = $storeGroupOrigin != null ? array_merge($storeGroupOrigin->getData(), $storeGroup->getData()) : $storeGroup->getData();
     $storeIndex->open()->getStoreGrid()->searchAndOpenStoreGroup($storeGroup);
     $formData = $editGroup->getEditFormGroup()->getData();
     $errors = $this->verifyData($fixtureData, $formData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
 /**
  * Assert that displayed Website data on edit page equals passed from fixture
  *
  * @param StoreIndex $storeIndex
  * @param EditWebsite $editWebsite
  * @param Website $website
  * @return void
  */
 public function processAssert(StoreIndex $storeIndex, EditWebsite $editWebsite, Website $website)
 {
     $fixtureData = $website->getData();
     $storeIndex->open()->getStoreGrid()->searchAndOpenWebsite($website);
     $formData = $editWebsite->getEditFormWebsite()->getData();
     $errors = $this->verifyData($fixtureData, $formData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
 /**
  * Assert that displayed sales rule data on edit page equals passed from fixture.
  *
  * @param PromoQuoteIndex $promoQuoteIndex
  * @param PromoQuoteEdit $promoQuoteEdit
  * @param SalesRule $salesRule
  * @return void
  */
 public function processAssert(PromoQuoteIndex $promoQuoteIndex, PromoQuoteEdit $promoQuoteEdit, SalesRule $salesRule)
 {
     $promoQuoteIndex->open();
     $promoQuoteIndex->getPromoQuoteGrid()->searchAndOpen(['name' => $salesRule->getName()]);
     $formData = $promoQuoteEdit->getSalesRuleForm()->getData();
     $errors = $this->verifyData($salesRule->getData(), $formData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
 /**
  * Assert that displayed product data on product page(front-end) equals passed from fixture:
  * 1. Product Name
  * 2. Price
  * 3. Special price
  * 4. SKU
  * 5. Description
  * 6. Short Description
  *
  * @param BrowserInterface $browser
  * @param CatalogProductView $catalogProductView
  * @param FixtureInterface $product
  * @return void
  */
 public function processAssert(BrowserInterface $browser, CatalogProductView $catalogProductView, FixtureInterface $product)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $this->product = $product;
     $this->productView = $catalogProductView->getViewBlock();
     $errors = $this->verify();
     \PHPUnit_Framework_Assert::assertEmpty($errors, "\nFound the following errors:\n" . implode(" \n", $errors));
 }
 /**
  * Assert that displayed Store View data on edit page equals passed from fixture
  *
  * @param StoreIndex $storeIndex
  * @param StoreNew $storeNew
  * @param Store $store
  * @return void
  */
 public function processAssert(StoreIndex $storeIndex, StoreNew $storeNew, Store $store)
 {
     $storeIndex->open()->getStoreGrid()->searchAndOpenStore($store);
     $formData = $storeNew->getStoreForm()->getData();
     $fixtureData = $store->getData();
     $errors = $this->verifyData($fixtureData, $formData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
 /**
  * Assertion that commodity options are displayed correctly.
  *
  * @param CatalogProductView $catalogProductView
  * @param InjectableFixture $product
  * @param Browser $browser
  * @return void
  */
 public function processAssert(CatalogProductView $catalogProductView, InjectableFixture $product, Browser $browser)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $fixtureCustomOptions = $this->prepareOptions($product);
     $formCustomOptions = $catalogProductView->getViewBlock()->getOptions($product)['custom_options'];
     $error = $this->verifyData($fixtureCustomOptions, $formCustomOptions);
     \PHPUnit_Framework_Assert::assertEmpty($error, $error);
 }
 /**
  * Assert form data equals fixture data.
  *
  * @param FixtureInterface $product
  * @param CatalogProductIndex $productGrid
  * @param CatalogProductEdit $productPage
  * @return void
  */
 public function processAssert(FixtureInterface $product, CatalogProductIndex $productGrid, CatalogProductEdit $productPage)
 {
     $filter = ['sku' => $product->getSku() . '-1'];
     $productGrid->open()->getProductGrid()->searchAndOpen($filter);
     $formData = $productPage->getProductForm()->getData($product);
     $fixtureData = $this->prepareFixtureData($product->getData());
     $errors = $this->verifyData($fixtureData, $formData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
 /**
  * Assert that review data equals passed from fixture on edit page.
  *
  * @param CatalogProductReview $reviewIndex
  * @param Review $review
  * @param CatalogProductReviewEdit $reviewEdit
  * @param string $status [optional]
  * @return void
  */
 public function processAssert(CatalogProductReview $reviewIndex, Review $review, CatalogProductReviewEdit $reviewEdit, $status = '')
 {
     $reviewIndex->open();
     $reviewIndex->getReviewGrid()->searchAndOpen(['title' => $review->getTitle()]);
     $fixtureData = $this->prepareFixtureData($review, $status);
     $formData = $reviewEdit->getReviewForm()->getData();
     $error = $this->verifyData($fixtureData, $formData);
     \PHPUnit_Framework_Assert::assertEmpty($error, $error);
 }
 /**
  * Assert that displayed target rule data on edit page equals passed from fixture.
  *
  * @param TargetRuleIndex $targetRuleIndex
  * @param TargetRule $targetRule
  * @param TargetRuleEdit $targetRuleEdit
  * @param array $replacementData
  * @return void
  */
 public function processAssert(TargetRuleIndex $targetRuleIndex, TargetRule $targetRule, TargetRuleEdit $targetRuleEdit, array $replacementData)
 {
     $fixtureData = $this->prepareData($targetRule->getData(), $replacementData['rule_information']);
     $targetRuleIndex->open();
     $targetRuleIndex->getTargetRuleGrid()->searchAndOpen(['name' => $targetRule->getName()]);
     $formData = $targetRuleEdit->getTargetRuleForm()->getData();
     $errors = $this->verifyData($fixtureData, $formData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
 /**
  * Assert that displayed banner data on edit page equals passed from fixture.
  *
  * @param BannerWidget $widget
  * @param WidgetInstanceIndex $widgetInstanceIndex
  * @param WidgetInstanceEdit $widgetInstanceEdit
  * @return void
  */
 public function processAssert(BannerWidget $widget, WidgetInstanceIndex $widgetInstanceIndex, WidgetInstanceEdit $widgetInstanceEdit)
 {
     $widgetInstanceIndex->open();
     $widgetInstanceIndex->getWidgetGrid()->searchAndOpen(['title' => $widget->getTitle()]);
     $formData = $widgetInstanceEdit->getWidgetForm()->getData($widget);
     $fixtureData = $this->prepareData($widget->getData());
     $errors = $this->verifyData($fixtureData, $formData);
     \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
 }
 /**
  * Assert that product rating is displayed on product review(backend) page.
  *
  * @param CatalogProductReview $reviewIndex
  * @param CatalogProductReviewEdit $reviewEdit
  * @param Review $review
  * @return void
  */
 public function processAssert(CatalogProductReview $reviewIndex, CatalogProductReviewEdit $reviewEdit, Review $review)
 {
     $reviewIndex->open();
     $reviewIndex->getReviewGrid()->searchAndOpen(['title' => $review->getTitle()]);
     $ratingReview = $this->sortDataByPath($review->getRatings(), '::title');
     $ratingForm = $this->sortDataByPath($reviewEdit->getReviewForm()->getData()['ratings'], '::title');
     $error = $this->verifyData($ratingReview, $ratingForm);
     \PHPUnit_Framework_Assert::assertEmpty($error, $error);
 }
Example #25
0
 /**
  * Assert that tax rule form filled right.
  *
  * @param TaxRuleNew $taxRuleNew
  * @param TaxRuleIndex $taxRuleIndex
  * @param TaxRule $taxRule
  * @return void
  */
 public function processAssert(TaxRuleNew $taxRuleNew, TaxRuleIndex $taxRuleIndex, TaxRule $taxRule)
 {
     $fixtureData = $taxRule->getData();
     $taxRuleIndex->open();
     $taxRuleIndex->getTaxRuleGrid()->searchAndOpen(['code' => $taxRule->getCode()]);
     $formData = $taxRuleNew->getTaxRuleForm()->getData($taxRule);
     $dataDiff = $this->verifyForm($formData, $fixtureData);
     \PHPUnit_Framework_Assert::assertEmpty($dataDiff, implode($dataDiff));
 }
 /**
  * Assert that displayed category data on edit page equals passed from fixture.
  *
  * @param CatalogCategoryIndex $catalogCategoryIndex
  * @param CatalogCategoryEdit $catalogCategoryEdit
  * @param Category $category
  * @return void
  */
 public function processAssert(CatalogCategoryIndex $catalogCategoryIndex, CatalogCategoryEdit $catalogCategoryEdit, Category $category)
 {
     $catalogCategoryIndex->open();
     $catalogCategoryIndex->getTreeCategories()->selectCategory($category, true);
     $fixtureData = $this->prepareFixtureData($category->getData());
     $formData = $catalogCategoryEdit->getEditForm()->getData($category);
     $error = $this->verifyData($this->sortData($fixtureData), $this->sortData($formData));
     \PHPUnit_Framework_Assert::assertEmpty($error, $error);
 }
Example #27
0
 public function testValidateComponents()
 {
     $validator = $this->newValidator();
     $nonce = time();
     $expected_signature = $this->expectedSignature($nonce);
     // will throw an exception if it fails
     $validator->validate('GET', 'http://somesite.com/sample/url', ['foo' => 'bar'], null, 'myapi123', $nonce, $expected_signature, 'mysecret456', $error_info);
     PHPUnit::assertEmpty($error_info);
 }
 /**
  * Assert that Samples links are present on the downloadable product on front-end.
  *
  * @param CatalogProductView $productView
  * @param DownloadableProduct $product
  * @param Browser $browser
  * @return void
  */
 public function processAssert(CatalogProductView $productView, DownloadableProduct $product, Browser $browser)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $fixtureSampleLinks = $this->prepareFixtureData($product);
     $pageOptions = $productView->getViewBlock()->getOptions($product);
     $pageSampleLinks = isset($pageOptions['downloadable_options']['downloadable_sample']) ? $this->preparePageData($pageOptions['downloadable_options']['downloadable_sample']) : [];
     $error = $this->verifyData($fixtureSampleLinks, $pageSampleLinks);
     \PHPUnit_Framework_Assert::assertEmpty($error, $error);
 }
 /**
  * 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);
 }
 /**
  * Assert that Catalog Price Rule is applied for product(s) in Catalog
  * according to Priority(Priority/Stop Further Rules Processing).
  *
  * @param InjectableFixture $product
  * @param CmsIndex $cmsIndex
  * @param CatalogCategoryView $catalogCategoryView
  * @param array $prices
  * @return void
  */
 public function processAssert(InjectableFixture $product, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, array $prices)
 {
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategory($product->getCategoryIds()[0]);
     $formPrices = $this->getFormPrices($product, $catalogCategoryView);
     $fixturePrices = $this->prepareFixturePrices($prices);
     $diff = $this->verifyData($fixturePrices, $formPrices);
     \PHPUnit_Framework_Assert::assertEmpty($diff, $diff . "\n On: " . date('l jS \\of F Y h:i:s A'));
 }