Esempio n. 1
0
 /**
  * Matcher condition.
  *
  * @param array $actual
  *
  * @throws \InvalidArgumentException If $actual variable not an array or instance of Traversable.
  * @return bool
  */
 protected function condition($actual)
 {
     if (!(is_array($actual) || $actual instanceof \Traversable) || count($actual) === 0) {
         throw new \InvalidArgumentException('Actual variable must be a not empty array or instance of Traversable.');
     }
     foreach ($actual as $number => $value) {
         $this->number = $number;
         if (!$this->expected->condition($value)) {
             return false;
         }
     }
     return true;
 }
Esempio n. 2
0
 /**
  * @inheritdoc
  */
 protected function condition($actual)
 {
     return !$this->expected->condition($actual);
 }