当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPUnit_Framework_Assert::assertEmpty方法代码示例

本文整理汇总了PHP中PHPUnit_Framework_Assert::assertEmpty方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::assertEmpty方法的具体用法?PHP PHPUnit_Framework_Assert::assertEmpty怎么用?PHP PHPUnit_Framework_Assert::assertEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPUnit_Framework_Assert的用法示例。


在下文中一共展示了PHPUnit_Framework_Assert::assertEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: iShouldHaveTheFollowingHistoryEntries

 /**
  * @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');
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:36,代码来源:HistoryDefinitionsTrait.php

示例2: processAssert

 /**
  * 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);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:AssertAttributeForm.php

示例3: testDeleteComposedTransaction

 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']);
 }
开发者ID:CryptArc,项目名称:xchain,代码行数:26,代码来源:ComposedTransactionRepositoryTest.php

示例4: testUnconfirmingAnInvalidatedTransaction

 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);
 }
开发者ID:CryptArc,项目名称:xchain,代码行数:26,代码来源:ProvisionalTransactionsTest.php

示例5: processAssert

 /**
  * 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);
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:17,代码来源:AssertGiftCardAccountForm.php

示例6: processAssert

 /**
  * 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));
 }
开发者ID:QiuLihua83,项目名称:magento-ee,代码行数:16,代码来源:AssertCustomerSegmentForm.php

示例7: assertProductDetails

 /**
  * 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);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:16,代码来源:AbstractAssertWishlistProductDetails.php

示例8: processAssert

 /**
  * 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);
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:16,代码来源:AssertCmsPageForm.php

示例9: processAssert

 /**
  * 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);
 }
开发者ID:MikeTayC,项目名称:magento.dev,代码行数:16,代码来源:AssertGiftRegistryTypeForm.php

示例10: processAssert

 /**
  * 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);
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:16,代码来源:AssertTaxRateForm.php

示例11: processAssert

 /**
  * 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();
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:16,代码来源:AssertIntegrationResourcesPopup.php

示例12: processAssert

 /**
  * 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);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:18,代码来源:AssertSearchTermReportForm.php

示例13: processAssert

 /**
  * 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);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:17,代码来源:AssertStoreGroupForm.php

示例14: processAssert

 /**
  * 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);
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:16,代码来源:AssertWebsiteForm.php

示例15: processAssert

 /**
  * 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);
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:16,代码来源:AssertCartPriceRuleForm.php


注:本文中的PHPUnit_Framework_Assert::assertEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。