for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Test\Buy;
use Facebook\WebDriver\WebDriverBy;
use Facebook\WebDriver\WebDriverExpectedCondition;
/**
* Class BuyPromotedTest
* @package Test\Buy
*
* @group oscommerce-buy-promoted
*/
class BuyPromotedTest extends AbstractBuy
{
* @var String $orderUrl
public $orderUrl;
* Test Buy Promoted
public function testBuyPromoted()
$this->prepareProductAndCheckout(true);
$this->quit();
die;
exit
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.
$this->login();
$this->login()
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.
return
die
function fx() { try { doSomething(); return true; } catch (\Exception $e) { return false; } return false; }
In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.
return false
$this->fillShippingMethod();
$this->fillPaymentMethod();
// get cart total price
// $button = WebDriverBy::xpath("//td[@class='main']/strong[1]");
// $condition = WebDriverExpectedCondition::visibilityOfElementLocated($button);
// $this->waitUntil($condition);
// $cartPrice = $this->findByXpath("//td[@class='main']/strong[1]")->getText();
// --------------------
$this->goToPagantis();
$this->verifyPagantis();
$this->commitPurchase();
$this->checkPurchaseReturn(self::CORRECT_PURCHASE_MESSAGE);
}
protected function checkPromoted()
$elememt = WebDriverBy::id("promotedText");
$condition = WebDriverExpectedCondition::visibilityOfElementLocated($elememt);
$this->waitUntil($condition);
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.