Issues (142)

test/Buy/BuyPromotedTest.php (2 issues)

1
<?php
2
3
namespace Test\Buy;
4
5
use Facebook\WebDriver\WebDriverBy;
6
use Facebook\WebDriver\WebDriverExpectedCondition;
7
8
/**
9
 * Class BuyPromotedTest
10
 * @package Test\Buy
11
 *
12
 * @group oscommerce-buy-promoted
13
 */
14
class BuyPromotedTest extends AbstractBuy
15
{
16
    /**
17
     * @var String $orderUrl
18
     */
19
    public $orderUrl;
20
21
    /**
22
     * Test Buy Promoted
23
     */
24
    public function testBuyPromoted()
25
    {
26
        $this->prepareProductAndCheckout(true);
27
        $this->quit();
28
        die;
0 ignored issues
show
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
29
        $this->login();
0 ignored issues
show
$this->login() is not reachable.

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.

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.

Loading history...
30
        $this->fillShippingMethod();
31
        $this->fillPaymentMethod();
32
33
        // get cart total price
34
        // $button = WebDriverBy::xpath("//td[@class='main']/strong[1]");
35
        // $condition = WebDriverExpectedCondition::visibilityOfElementLocated($button);
36
        // $this->waitUntil($condition);
37
        // $cartPrice = $this->findByXpath("//td[@class='main']/strong[1]")->getText();
38
39
40
        // --------------------
41
        $this->goToPagantis();
42
        $this->verifyPagantis();
43
        $this->commitPurchase();
44
        $this->checkPurchaseReturn(self::CORRECT_PURCHASE_MESSAGE);
45
        $this->quit();
46
    }
47
48
    /**
49
     *
50
     */
51
    protected function checkPromoted()
52
    {
53
        $elememt = WebDriverBy::id("promotedText");
54
        $condition = WebDriverExpectedCondition::visibilityOfElementLocated($elememt);
55
        $this->waitUntil($condition);
56
57
    }
58
}
59