Exemplo n.º 1
0
 public function __construct($node, $parent)
 {
     parent::__construct($node, $parent);
     self::$possible_attributes = array_merge(parent::$possible_attributes, self::$possible_attributes);
     self::$required_attributes = array_merge(parent::$required_attributes, self::$required_attributes);
     self::$possible_children = array_merge(parent::$possible_children, self::$possible_children);
     self::$required_children = array_merge(parent::$required_children, self::$required_children);
 }
Exemplo n.º 2
0
 /**
  * Parses the parameters to add user-defined contains strings.
  */
 private function _initialize()
 {
     $params = $this->getParameters();
     if ($params !== null) {
         foreach ($params as $param) {
             if (self::CONTAINS_KEY == $param->getType()) {
                 $cont = new Contains();
                 $cont->setValue($param->getValue());
                 array_push($this->_contains, $cont);
                 break;
                 // because we only support a single contains
             }
         }
     }
 }
Exemplo n.º 3
0
 public function __construct($key, $values)
 {
     parent::__construct($key, [$values]);
 }
Exemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 protected function isConditionAllowed($context)
 {
     return !parent::isConditionAllowed($context);
 }
Exemplo n.º 5
0
 /**
  * @dataProvider providerForNotContains
  * @expectedException Respect\Validation\Exceptions\ContainsException
  */
 public function test_strings_NOT_contains_expected_value_shoud_NOT_pass($start, $input, $identical = false)
 {
     $v = new Contains($start, $identical);
     $this->assertFalse($v->validate($input));
     $this->assertFalse($v->assert($input));
 }
Exemplo n.º 6
0
 /**
  * @dataProvider providerForNotContains
  * @expectedException Respect\Validation\Exceptions\ContainsException
  */
 public function testStringsNotContainsExpectedValueShouldNotPass($start, $input, $identical = false)
 {
     $v = new Contains($start, $identical);
     $this->assertFalse($v->__invoke($input));
     $this->assertFalse($v->assert($input));
 }
Exemplo n.º 7
0
 /**
  * @dataProvider providerForNotContains
  */
 public function testStringsNotContainsExpectedValueShouldNotPass($start, $input)
 {
     $v = new Contains($start, false);
     $this->assertFalse($v->validate($input));
 }