예제 #1
0
파일: AllValues.php 프로젝트: komex/unteist
 /**
  * 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;
 }
예제 #2
0
파일: Not.php 프로젝트: komex/unteist
 /**
  * @inheritdoc
  */
 protected function condition($actual)
 {
     return !$this->expected->condition($actual);
 }