本文整理汇总了PHP中PHPUnit_Framework_Assert::assertFalse方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::assertFalse方法的具体用法?PHP PHPUnit_Framework_Assert::assertFalse怎么用?PHP PHPUnit_Framework_Assert::assertFalse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Assert
的用法示例。
在下文中一共展示了PHPUnit_Framework_Assert::assertFalse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testIsValidAssetName
public function testIsValidAssetName()
{
PHPUnit::assertTrue(Validator::isValidAssetName('MYTOKEN'));
PHPUnit::assertTrue(Validator::isValidAssetName('A95428956661682202'));
PHPUnit::assertFalse(Validator::isValidAssetName('ABADTOKEN'));
PHPUnit::assertTrue(Validator::isValidAssetNames(['MYTOKEN', 'MYTOKENTWO']));
}
示例2: assertSessionDoesntHave
public function assertSessionDoesntHave($key)
{
if (is_array($key)) {
return $this->assertSessionDoesntHaveAll($key);
}
PHPUnit::assertFalse($this->app['session.store']->has($key), "Session contains key: {$key}");
}
示例3: 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.');
}
}
}
示例4: processAssert
/**
* Assert that deleted attribute can't be used for Products' Export
*
* @param AdminExportIndex $exportIndex
* @param CatalogProductAttribute $attribute
* @param ImportExport $export
* @return void
*/
public function processAssert(AdminExportIndex $exportIndex, CatalogProductAttribute $attribute, ImportExport $export)
{
$exportIndex->open();
$exportIndex->getExportForm()->fill($export);
$filter = ['attribute_code' => $attribute->getAttributeCode()];
\PHPUnit_Framework_Assert::assertFalse($exportIndex->getFilterExport()->isRowVisible($filter), 'Attribute \'' . $attribute->getFrontendLabel() . '\' is present in Filter export grid');
}
示例5: processAssert
/**
* Assert that products' MAP has been applied before checkout.
*
* @param CatalogCategory $category
* @param Customer $customer
* @param Address $address
* @param CatalogCategoryView $catalogCategoryView
* @param CmsIndex $cmsIndex
* @param CatalogProductView $catalogProductView
* @param CheckoutCart $cart
* @param CheckoutOnepage $checkoutOnePage
* @param array $products
* @return void
*/
public function processAssert(CatalogCategory $category, Customer $customer, Address $address, CatalogCategoryView $catalogCategoryView, CmsIndex $cmsIndex, CatalogProductView $catalogProductView, CheckoutCart $cart, CheckoutOnepage $checkoutOnePage, array $products)
{
for ($i = 0; $i < count($products); $i++) {
$cart->getCartBlock()->clearShoppingCart();
$productName = $products[$i]->getName();
$cmsIndex->open();
$cmsIndex->getTopmenu()->selectCategory($category->getName());
// Check that price is not present on category page.
$listProductBlock = $catalogCategoryView->getListProductBlock();
$productPriceBlock = $listProductBlock->getProductPriceBlock($productName);
$productPriceBlock->clickForPrice();
\PHPUnit_Framework_Assert::assertFalse($productPriceBlock->getMapBlock()->isPriceVisible(), 'Price is present in MSRP dialog on category page.');
// Check that price is not present on product page.
$listProductBlock->openProductViewPage($productName);
\PHPUnit_Framework_Assert::assertFalse($catalogProductView->getViewBlock()->getPriceBlock()->isRegularPriceVisible(), 'Price is present in View block on product page.');
// Check that price is not present on cart.
$catalogProductView->getViewBlock()->addToCart($products[$i]);
\PHPUnit_Framework_Assert::assertTrue($cart->getCartBlock()->getCartItem($products[$i])->isMsrpVisible(), "MSRP link is not visible in cart.");
// Check that price is present on review block in onepage checkout page.
$cart->getCartBlock()->getProceedToCheckoutBlock()->proceedToCheckout();
$checkoutMethodBlock = $checkoutOnePage->getLoginBlock();
$billingBlock = $checkoutOnePage->getBillingBlock();
$paymentMethodBlock = $checkoutOnePage->getPaymentMethodsBlock();
$shippingBlock = $checkoutOnePage->getShippingMethodBlock();
$checkoutMethodBlock->guestCheckout();
$checkoutMethodBlock->clickContinue();
$billingBlock->fillBilling($address, $customer);
$billingBlock->clickContinue();
$shippingBlock->selectShippingMethod(['shipping_service' => 'Flat Rate', 'shipping_method' => 'Fixed']);
$shippingBlock->clickContinue();
$paymentMethodBlock->selectPaymentMethod(['method' => 'checkmo']);
$paymentMethodBlock->clickContinue();
\PHPUnit_Framework_Assert::assertEquals(number_format($products[$i]->getPrice(), 2), $checkoutOnePage->getReviewBlock()->getTotalBlock()->getData('subtotal'), "Subtotal in checkout one page for {$productName} is not equal to expected.");
}
}
示例6: processAssert
/**
* Assert that Wishlist can't be find by another Customer (or guest) via "Wishlist Search".
*
* @param CustomerAccountLogout $customerAccountLogout
* @param CmsIndex $cmsIndex
* @param CatalogCategoryView $catalogCategoryView
* @param SearchResult $searchResult
* @param CatalogCategory $category
* @param Customer $customer
* @param Wishlist $wishlist
* @return void
*/
public function processAssert(CustomerAccountLogout $customerAccountLogout, CmsIndex $cmsIndex, CatalogCategoryView $catalogCategoryView, SearchResult $searchResult, CatalogCategory $category, Customer $customer, Wishlist $wishlist)
{
$customerAccountLogout->open();
$cmsIndex->open()->getTopmenu()->selectCategory($category->getName());
$catalogCategoryView->getWishlistSearchBlock()->searchByCustomer($customer);
\PHPUnit_Framework_Assert::assertFalse($searchResult->getWishlistSearchResultBlock()->isWishlistVisibleInGrid($wishlist), "Multiple wishlist is visible on wishlist search result page.");
}
示例7: processAssert
/**
* Assert that video is displayed 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::assertFalse(strpos($src, '/placeholder/') !== false, 'Video preview image is not displayed on category view when it should.');
}
示例8: processAssert
/**
* Assert that deleted attribute can't be added to product template on Product Page via Add Attribute control
*
* @param CatalogProductAttribute $productAttribute
* @param CatalogProductIndex $productGrid
* @param CatalogProductNew $newProductPage
* @param CatalogProductEdit $productEdit
* @return void
*/
public function processAssert(CatalogProductAttribute $productAttribute, CatalogProductIndex $productGrid, CatalogProductEdit $productEdit, CatalogProductNew $newProductPage)
{
$productGrid->open();
$productGrid->getGridPageActionBlock()->addProduct('simple');
$productEdit->getForm()->openVariationsTab();
\PHPUnit_Framework_Assert::assertFalse($newProductPage->getForm()->checkAttributeInVariationsSearchAttributeForm($productAttribute), "Product attribute found in Attribute Search form.");
}
示例9: processAssert
/**
* Assert order is not visible in customer account on frontend
*
* @param OrderInjectable $order
* @param Customer $customer
* @param CustomerAccountIndex $customerAccountIndex
* @param OrderHistory $orderHistory
* @param string $status
* @return void
*/
public function processAssert(OrderInjectable $order, Customer $customer, CustomerAccountIndex $customerAccountIndex, OrderHistory $orderHistory, $status)
{
$filter = ['id' => $order->getId(), 'status' => $status];
$this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
$customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Orders');
\PHPUnit_Framework_Assert::assertFalse($orderHistory->getOrderHistoryBlock()->isVisible() && $orderHistory->getOrderHistoryBlock()->isOrderVisible($filter), 'Order with following data \'' . implode(', ', $filter) . '\' is present in Orders block on frontend.');
}
示例10: processAssert
/**
* Assert that product rating is not displayed on frontend on product review
*
* @param CatalogProductView $catalogProductView
* @param CatalogProductSimple $product
* @param Rating $productRating
* @param BrowserInterface $browser
* @return void
*/
public function processAssert(CatalogProductView $catalogProductView, CatalogProductSimple $product, Rating $productRating, BrowserInterface $browser)
{
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$catalogProductView->getReviewSummary()->getAddReviewLink()->click();
$reviewForm = $catalogProductView->getReviewFormBlock();
\PHPUnit_Framework_Assert::assertFalse($reviewForm->isVisibleRating($productRating), 'Product rating "' . $productRating->getRatingCode() . '" is displayed.');
}
示例11: testAddTXOsFromReceive
public function testAddTXOsFromReceive()
{
// receiving a transaction adds TXOs
$txo_repository = $this->app->make('App\\Repositories\\TXORepository');
// setup monitors
$payment_address_helper = app('PaymentAddressHelper');
$receiving_address_one = $payment_address_helper->createSamplePaymentAddressWithoutInitialBalances(null, ['address' => '1JztLWos5K7LsqW5E78EASgiVBaCe6f7cD']);
// receive unconfirmed transactions
$parsed_txs = $this->receiveUnconfirmedTransactions(1);
$loaded_txos = $txo_repository->findAll();
PHPUnit::assertCount(1, $loaded_txos);
$loaded_txo = $loaded_txos[0];
PHPUnit::assertEquals('0000000000000000000000000000000000000000000000000000000000000001', $loaded_txo['txid']);
PHPUnit::assertEquals(0, $loaded_txo['n']);
PHPUnit::assertEquals(TXO::UNCONFIRMED, $loaded_txo['type']);
PHPUnit::assertEquals(400000, $loaded_txo['amount']);
// confirm the transactions (1)
$this->sendConfirmationEvents(1, $parsed_txs);
$loaded_txo = $txo_repository->findAll()[0];
PHPUnit::assertEquals(TXO::UNCONFIRMED, $loaded_txo['type']);
PHPUnit::assertFalse($loaded_txo['green']);
// confirm the transactions (2)
$this->sendConfirmationEvents(2, $parsed_txs);
$loaded_txo = $txo_repository->findAll()[0];
PHPUnit::assertEquals(TXO::CONFIRMED, $loaded_txo['type']);
}
示例12: processAssert
/**
* Assert that products are absent in shopping cart.
*
* @param CheckoutCart $checkoutCart
* @param array $products
* @return void
*/
public function processAssert(CheckoutCart $checkoutCart, array $products)
{
$checkoutCart->open();
foreach ($products as $product) {
\PHPUnit_Framework_Assert::assertFalse($checkoutCart->getCartBlock()->getCartItem($product)->isVisible(), 'Product ' . $product->getName() . ' is present in shopping cart.');
}
}
示例13: processAssert
/**
* Assert that the category cannot be accessed from the navigation bar in the frontend
*
* @param CmsIndex $cmsIndex
* @param Category $category
* @param BrowserInterface $browser
* @return void
*/
public function processAssert(CmsIndex $cmsIndex, Category $category, BrowserInterface $browser)
{
$cmsIndex->open();
\PHPUnit_Framework_Assert::assertFalse($cmsIndex->getTopmenu()->isCategoryVisible($category->getName()), 'Category can be accessed from the navigation bar in the frontend.');
$browser->open($_ENV['app_frontend_url'] . $category->getUrlKey() . '.html');
\PHPUnit_Framework_Assert::assertEquals(self::NOT_FOUND_MESSAGE, $cmsIndex->getTitleBlock()->getTitle(), 'Wrong page is displayed.');
}
示例14: processAssert
/**
* Assert that 'Button name' button is absent order page.
*
* @param SalesOrderView $salesOrderView
* @param SalesOrderIndex $orderIndex
* @param Order $order
* @param string|null $orderId
* @return void
*/
public function processAssert(SalesOrderView $salesOrderView, SalesOrderIndex $orderIndex, Order $order = null, $orderId = null)
{
$orderIndex->open();
$orderId = $orderId == null ? $order->getId() : $orderId;
$orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]);
\PHPUnit_Framework_Assert::assertFalse($salesOrderView->getPageActions()->isActionButtonVisible($this->buttonName), "'{$this->buttonName}' button is present on order view page.");
}
示例15: toBeFalse
public function toBeFalse()
{
if ($this->negate) {
a::assertNotFalse($this->actual);
} else {
a::assertFalse($this->actual);
}
}