示例#1
0
 /**
  * {@inheritdoc}
  */
 public function isOrderWithNumberInTheList($number)
 {
     try {
         $rows = $this->tableAccessor->getRowsWithFields($this->getElement('customer_orders'), ['number' => $number]);
         return 1 === count($rows);
     } catch (\InvalidArgumentException $exception) {
         return false;
     }
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function isResourceOnPage(array $parameters)
 {
     try {
         $rows = $this->tableAccessor->getRowsWithFields($this->getElement('table'), $parameters);
         return 1 === count($rows);
     } catch (\InvalidArgumentException $exception) {
         return false;
     } catch (ElementNotFoundException $exception) {
         return false;
     }
 }
示例#3
0
 /**
  * {@inheritdoc}
  */
 public function isSingleResourceWithSpecificElementOnPage(array $parameters, $element)
 {
     try {
         $rows = $this->tableAccessor->getRowsWithFields($this->getElement('table'), $parameters);
         if (1 !== count($rows)) {
             return false;
         }
         return null !== $rows[0]->find('css', $element);
     } catch (\InvalidArgumentException $exception) {
         return false;
     } catch (ElementNotFoundException $exception) {
         return false;
     }
 }
示例#4
0
 /**
  * {@inheritdoc}
  */
 public function isProductInTheList($name)
 {
     try {
         $rows = $this->tableAccessor->getRowsWithFields($this->getElement('order_items'), ['item' => $name]);
         return 1 === count($rows);
     } catch (\InvalidArgumentException $exception) {
         return false;
     }
 }
示例#5
0
 /**
  * @param string $itemName
  * @param string $property
  *
  * @return string
  */
 private function getItemProperty($itemName, $property)
 {
     $rows = $this->tableAccessor->getRowsWithFields($this->getElement('table'), ['item' => $itemName]);
     return $rows[0]->find('css', '.' . $property)->getText();
 }
示例#6
0
 /**
  * {@inheritdoc}
  */
 public function countPaymentWithSpecificState($state)
 {
     $rows = $this->tableAccessor->getRowsWithFields($this->getElement('table'), ['state' => $state]);
     return count($rows);
 }