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


PHP PHPUnit_Framework_Assert::assertTrue方法代码示例

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


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

示例1: processAssert

 /**
  * Assert bestseller info in report: date, product name and qty.
  *
  * @param Bestsellers $bestsellers
  * @param OrderInjectable $order
  * @param string $date
  * @return void
  */
 public function processAssert(Bestsellers $bestsellers, OrderInjectable $order, $date)
 {
     /** @var CatalogProductSimple $product */
     $product = $order->getEntityId()['products'][0];
     $filter = ['date' => date($date), 'product' => $product->getName(), 'price' => $product->getPrice(), 'orders' => $product->getCheckoutData()['qty']];
     \PHPUnit_Framework_Assert::assertTrue($bestsellers->getGridBlock()->isRowVisible($filter, false), 'Bestseller does not present in report grid.');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:15,代码来源:AssertBestsellerReportResult.php

示例2: processAssert

 /**
  * Assert that apache redirect works by opening category page and asserting index.php in its url.
  *
  * @param CatalogCategory $category
  * @param CmsIndex $homePage
  * @param BrowserInterface $browser
  */
 public function processAssert(CatalogCategory $category, CmsIndex $homePage, BrowserInterface $browser)
 {
     $category->persist();
     $homePage->open();
     $homePage->getTopmenu()->selectCategory($category->getName());
     \PHPUnit_Framework_Assert::assertTrue(strpos($browser->getUrl(), 'index.php') === false, 'Apache redirect for category does not work.');
 }
开发者ID:MikeTayC,项目名称:magento.dev,代码行数:14,代码来源:AssertRewritesEnabled.php

示例3: processAssert

 /**
  * Assert that product is present in grid on customer's wish list tab with configure option and qty
  *
  * @param CustomerIndexEdit $customerIndexEdit
  * @param FixtureInterface $product
  * @return void
  */
 public function processAssert(CustomerIndexEdit $customerIndexEdit, FixtureInterface $product)
 {
     $filter = $this->prepareFilter($product);
     /** @var Grid $wishlistGrid */
     $wishlistGrid = $customerIndexEdit->getCustomerForm()->getTabElement('wishlist')->getSearchGridBlock();
     \PHPUnit_Framework_Assert::assertTrue($wishlistGrid->isRowVisible($filter, true, false), 'Product ' . $product->getName() . ' is absent in grid with configure option.');
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:14,代码来源:AssertProductInCustomerWishlistOnBackendGrid.php

示例4: testGetDirectory

 public function testGetDirectory()
 {
     $dir = new FooDirectory($this->getMongoDB());
     $model = $dir->create();
     $directory = $model->getDirectory();
     PHPUnit::assertTrue($directory instanceof FooDirectory);
 }
开发者ID:deweller,项目名称:mongomodel,代码行数:7,代码来源:BaseModelTest.php

示例5: processAssert

 /**
  * Assert that created gift registry type can be found on frontend.
  *
  * @param Customer $customer
  * @param GiftRegistryType $giftRegistryType
  * @param CustomerAccountIndex $customerAccountIndex
  * @param GiftRegistryIndex $giftRegistryIndex
  * @param GiftRegistryAddSelect $giftRegistryAddSelect
  * @return void
  */
 public function processAssert(Customer $customer, GiftRegistryType $giftRegistryType, CustomerAccountIndex $customerAccountIndex, GiftRegistryIndex $giftRegistryIndex, GiftRegistryAddSelect $giftRegistryAddSelect)
 {
     $this->objectManager->create('Mage\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     $customerAccountIndex->getAccountNavigationBlock()->openNavigationItem("Gift Registry");
     $giftRegistryIndex->getGiftRegistryList()->addNew();
     \PHPUnit_Framework_Assert::assertTrue($giftRegistryAddSelect->getGiftRegistryEditForm()->isGiftRegistryVisible($giftRegistryType), "Gift registry '{$giftRegistryType->getLabel()}' is not present on frontend.");
 }
开发者ID:QiuLihua83,项目名称:magento-ee,代码行数:17,代码来源:AssertGiftRegistryTypeOnFrontend.php

示例6: processAssert

 /**
  * Assert that products are displayed in up-sell section.
  *
  * @param Browser $browser
  * @param FixtureInterface $product
  * @param array $upSellProducts
  * @param CatalogProductView $catalogProductView
  * @return void
  */
 public function processAssert(Browser $browser, FixtureInterface $product, array $upSellProducts, CatalogProductView $catalogProductView)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     foreach ($upSellProducts as $upSellProduct) {
         \PHPUnit_Framework_Assert::assertTrue($catalogProductView->getUpsellBlock()->getItemBlock($upSellProduct)->isVisible(), "Product {$upSellProduct->getName()} is absent in up-sells products.");
     }
 }
开发者ID:MikeTayC,项目名称:magento.dev,代码行数:16,代码来源:AssertUpSellProductsSection.php

示例7: processAssert

 /**
  * Assert that video is absent on category page on Store front.
  *
  * @param CmsIndex $cmsIndex
  * @param CatalogCategoryView $catalogCategoryView
  * @param InjectableFixture $initialProduct
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, InjectableFixture $initialProduct)
 {
     $cmsIndex->open();
     $cmsIndex->getTopmenu()->selectCategoryByName($initialProduct->getCategoryIds()[0]);
     $src = $catalogCategoryView->getListProductBlock()->getProductItem($initialProduct)->getBaseImageSource();
     \PHPUnit_Framework_Assert::assertTrue(strpos($src, '/placeholder/') !== false, 'Product image is displayed on category view when it should not.');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:15,代码来源:AssertNoVideoCategoryView.php

示例8: processAssert

 /**
  * Assert customer availability in Customer Grid.
  *
  * @param Customer $customer
  * @param CustomerIndex $pageCustomerIndex
  * @param Customer $initialCustomer [optional]
  * @return void
  *
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 public function processAssert(Customer $customer, CustomerIndex $pageCustomerIndex, Customer $initialCustomer = null)
 {
     $data = $this->prepareData($customer, $initialCustomer);
     $filter = ['name' => $data[0], 'email' => $data[1]['email']];
     $pageCustomerIndex->open();
     \PHPUnit_Framework_Assert::assertTrue($pageCustomerIndex->getCustomerGridBlock()->isRowVisible($filter), 'Customer with ' . 'name \'' . $filter['name'] . '\', ' . 'email \'' . $filter['email'] . '\' ' . 'is absent in Customer grid.');
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:17,代码来源:AssertCustomerInGrid.php

示例9: assertDestinationCorrect

 public function assertDestinationCorrect(ezcWebdavMemoryBackend $backend)
 {
     PHPUnit_Framework_Assert::assertTrue($backend->nodeExists('/other_collection/moved_resource.html'));
     $prop = $backend->getProperty('/other_collection/moved_resource.html', 'lockdiscovery');
     PHPUnit_Framework_Assert::assertNotNull($prop, 'Lock discovery property not available on destination.');
     PHPUnit_Framework_Assert::assertEquals(0, count($prop->activeLock), 'Active lock available on destination.');
 }
开发者ID:bmdevel,项目名称:ezc,代码行数:7,代码来源:015_move_resource_destination_not_locked_success_assertions.php

示例10: processAssert

 /**
  * Check whether the attribute filter is displayed on the frontend in Layered navigation.
  *
  * @param CatalogCategoryView $catalogCategoryView
  * @param InjectableFixture $product
  * @param CatalogProductAttribute $attribute
  * @param CmsIndex $cmsIndex
  * @param FixtureFactory $fixtureFactory
  * @return void
  */
 public function processAssert(CatalogCategoryView $catalogCategoryView, InjectableFixture $product, CatalogProductAttribute $attribute, CmsIndex $cmsIndex, FixtureFactory $fixtureFactory)
 {
     $fixtureFactory->createByCode('catalogProductSimple', ['dataSet' => 'product_with_category_with_anchor', 'data' => ['category_ids' => ['presets' => null, 'category' => $product->getDataFieldConfig('category_ids')['source']->getCategories()[0]]]])->persist();
     $cmsIndex->open()->getTopmenu()->selectCategoryByName($product->getCategoryIds()[0]);
     $label = $attribute->hasData('manage_frontend_label') ? $attribute->getManageFrontendLabel() : $attribute->getFrontendLabel();
     \PHPUnit_Framework_Assert::assertTrue(in_array($label, $catalogCategoryView->getLayeredNavigationBlock()->getFilters()), 'Attribute is absent in layered navigation on category page.');
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:17,代码来源:AssertProductAttributeIsFilterable.php

示例11: processAssert

 /**
  * Assert that product is displayed in related products section.
  *
  * @param Browser $browser
  * @param CatalogProductSimple $product
  * @param InjectableFixture[] $relatedProducts
  * @param CatalogProductView $catalogProductView
  * @return void
  */
 public function processAssert(Browser $browser, CatalogProductSimple $product, array $relatedProducts, CatalogProductView $catalogProductView)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     foreach ($relatedProducts as $relatedProduct) {
         \PHPUnit_Framework_Assert::assertTrue($catalogProductView->getRelatedProductBlock()->getItemBlock($relatedProduct)->isVisible(), "Product {$relatedProduct->getName()} is absent in related products.");
     }
 }
开发者ID:QiuLihua83,项目名称:magento-ee,代码行数:16,代码来源:AssertRelatedProductsSection.php

示例12: processAssert

 /**
  * Assert that product attribute is global.
  *
  * @param CatalogProductAttribute $attribute
  * @param CatalogProductAttributeIndex $attributeIndexPage
  * @return void
  */
 public function processAssert(CatalogProductAttribute $attribute, CatalogProductAttributeIndex $attributeIndexPage)
 {
     $attributeIndexPage->open();
     $code = $attribute->getAttributeCode();
     $filter = ['attribute_code' => $code, 'is_global' => $attribute->getIsGlobal()];
     \PHPUnit_Framework_Assert::assertTrue($attributeIndexPage->getGrid()->isRowVisible($filter), "Attribute with attribute code '{$code}' isn't global.");
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:14,代码来源:AssertProductAttributeIsGlobal.php

示例13: processAssert

 /**
  * Assert Link block for downloadable product on front-end
  *
  * @param CatalogProductView $downloadableProductView
  * @param CatalogProductDownloadable $product
  * @param Browser $browser
  * @return void
  */
 public function processAssert(CatalogProductView $downloadableProductView, CatalogProductDownloadable $product, Browser $browser)
 {
     $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
     $linksBlock = $downloadableProductView->getDownloadableViewBlock()->getDownloadableLinksBlock();
     $fields = $product->getData();
     // Title for for Link block
     \PHPUnit_Framework_Assert::assertEquals($linksBlock->getTitleForLinkBlock(), $fields['downloadable_links']['title'], 'Title for for Link block for downloadable product on front-end is not correct.');
     $this->sortDownloadableArray($fields['downloadable_links']['downloadable']['link']);
     foreach ($fields['downloadable_links']['downloadable']['link'] as $index => $link) {
         $index++;
         // Titles for each links
         // Links are displaying according to Sort Order
         \PHPUnit_Framework_Assert::assertEquals($linksBlock->getItemTitle($index), $link['title'], 'Link item ' . $index . ' with title "' . $link['title'] . '" is not visible.');
         // If Links can be Purchase Separately, check-nob is presented near each link
         // If Links CANNOT be Purchase Separately, check-nob is not presented near each link
         if ($fields['downloadable_links']['links_purchased_separately'] == "Yes") {
             \PHPUnit_Framework_Assert::assertTrue($linksBlock->isVisibleItemCheckbox($index), 'Item ' . $index . ' link block CANNOT be Purchase Separately.');
             // Price is equals passed according to fixture
             $link['price'] = sprintf('$%1.2f', $link['price']);
             \PHPUnit_Framework_Assert::assertEquals($linksBlock->getItemPrice($index), $link['price'], 'Link item ' . $index . ' price is not visible.');
         } elseif ($fields['downloadable_links']['links_purchased_separately'] == "No") {
             \PHPUnit_Framework_Assert::assertFalse($linksBlock->isVisibleItemCheckbox($index), 'Item ' . $index . ' link block can be Purchase Separately.');
         }
     }
 }
开发者ID:aiesh,项目名称:magento2,代码行数:33,代码来源:AssertDownloadableLinksData.php

示例14: processAssert

 /**
  * Assert that order Id is present in search results
  *
  * @param Dashboard $dashboard
  * @param GlobalSearch $search
  * @return void
  */
 public function processAssert(Dashboard $dashboard, GlobalSearch $search)
 {
     $order = $search->getDataFieldConfig('query')['source']->getEntity();
     $orderId = "Order #" . $order->getId();
     $isVisibleInResult = $dashboard->getAdminPanelHeader()->isSearchResultVisible($orderId);
     \PHPUnit_Framework_Assert::assertTrue($isVisibleInResult, 'Order Id ' . $order->getId() . ' is absent in search results');
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:14,代码来源:AssertGlobalSearchOrderId.php

示例15: flushCacheStorageWithAssert

 /**
  * Flush cache storage and assert success message.
  *
  * @return void
  */
 protected function flushCacheStorageWithAssert()
 {
     $this->cachePage->open();
     $this->cachePage->getActionsBlock()->flushCacheStorage();
     $this->cachePage->getModalBlock()->acceptAlert();
     \PHPUnit_Framework_Assert::assertTrue($this->cachePage->getActionsBlock()->isStorageCacheFlushed(), 'Cache is not flushed.');
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:12,代码来源:AssertSetApprovedProductReview.php


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