Code Duplication    Length = 12-14 lines in 4 locations

src/Sylius/Behat/Page/Admin/Order/ShowPage.php 1 location

@@ 141-154 (lines=14) @@
138
    /**
139
     * {@inheritdoc}
140
     */
141
    public function isProductInTheList($productName)
142
    {
143
        try {
144
            $rows = $this->tableAccessor->getRowsWithFields(
145
                $this->getElement('table'),
146
                ['item' => $productName]
147
            );
148
149
            return 1 === count($rows);
150
151
        } catch (\InvalidArgumentException $exception) {
152
            return false;
153
        }
154
    }
155
156
    /**
157
     * {@inheritdoc}

src/Sylius/Behat/Page/Shop/Account/Order/IndexPage.php 1 location

@@ 65-78 (lines=14) @@
62
    /**
63
     * {@inheritdoc}
64
     */
65
    public function isOrderWithNumberInTheList($number)
66
    {
67
        try {
68
            $rows = $this->tableAccessor->getRowsWithFields(
69
                $this->getElement('customer_orders'),
70
                ['number' => $number]
71
            );
72
73
            return 1 === count($rows);
74
75
        } catch (\InvalidArgumentException $exception) {
76
            return false;
77
        }
78
    }
79
80
    /**
81
     * {@inheritdoc}

src/Sylius/Behat/Page/Shop/Account/Order/ShowPage.php 1 location

@@ 116-129 (lines=14) @@
113
    /**
114
     * {@inheritdoc}
115
     */
116
    public function isProductInTheList($name)
117
    {
118
        try {
119
            $rows = $this->tableAccessor->getRowsWithFields(
120
                $this->getElement('order_items'),
121
                ['item' => $name]
122
            );
123
124
            return 1 === count($rows);
125
126
        } catch (\InvalidArgumentException $exception) {
127
            return false;
128
        }
129
    }
130
131
    /**
132
     * {@inheritdoc}

src/Sylius/Behat/Page/Shop/Checkout/SummaryPage.php 1 location

@@ 64-75 (lines=12) @@
61
    /**
62
     * {@inheritdoc}
63
     */
64
    public function hasItemWithProductAndQuantity($productName, $quantity)
65
    {
66
        $table = $this->getElement('items_table');
67
68
        try {
69
            $this->tableAccessor->getRowWithFields($table, ['item' => $productName, 'qty' => $quantity]);
70
        } catch (\InvalidArgumentException $exception) {
71
            return false;
72
        }
73
74
        return true;
75
    }
76
77
    /**
78
     * {@inheritdoc}