本文整理汇总了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.');
}
示例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.');
}
示例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.');
}
示例4: testGetDirectory
public function testGetDirectory()
{
$dir = new FooDirectory($this->getMongoDB());
$model = $dir->create();
$directory = $model->getDirectory();
PHPUnit::assertTrue($directory instanceof FooDirectory);
}
示例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.");
}
示例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.");
}
}
示例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.');
}
示例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.');
}
示例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.');
}
示例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.');
}
示例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.");
}
}
示例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.");
}
示例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.');
}
}
}
示例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');
}
示例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.');
}