Beispiel #1
0
 /**
  * Constructor method for InviteTest
  * @param int $index
  * @param array $method
  * @param bool $negative
  * @return self
  */
 public function __construct($index, array $methods = [], $negative = null)
 {
     parent::__construct($index, $negative);
     $this->setMethods($methods);
     $this->on('before', function (FilterTest $sender) {
         if ($sender->getMethods()->count()) {
             $sender->setChild('method', $sender->getMethods()->all());
         }
     });
 }
Beispiel #2
0
 /**
  * Constructor method for InviteTest
  * @param int $index
  * @param array $method
  * @param bool $negative
  * @return self
  */
 public function __construct($index, array $method = array(), $negative = null)
 {
     parent::__construct($index, $negative);
     $this->_method = new Sequence();
     foreach ($method as $value) {
         $value = trim($value);
         if (!$this->_method->contains($value)) {
             $this->_method->add($value);
         }
     }
     $this->on('before', function (FilterTest $sender) {
         if ($sender->method()->count()) {
             $sender->child('method', $sender->method()->all());
         }
     });
 }
Beispiel #3
0
 /**
  * Constructor method for ImportanceTest
  * @param int $index Index - specifies a guaranteed order for the test elements
  * @param string $imp Importance
  * @param bool $negative Specifies a "not" condition for the test
  * @return self
  */
 public function __construct($index, Importance $imp, $negative = null)
 {
     parent::__construct($index, $negative);
     $this->setProperty('imp', $imp);
 }