Exemple #1
0
 function it_test()
 {
     $fields = ['TEST' => $this];
     $labels = ['ID' => 'ID', 'TEST' => 'TEST'];
     $key = 'TEST';
     $this->setParameters($key, $fields, $labels);
     $this->add(StringValidator::create()->notEmpty()->setMin(5)->setMessageMin('IS MIN'));
     $this->check('TEST')->shouldBe(false);
     $this->getEntity()->getErrors()->get('TEST')->shouldBe(['IS MIN']);
     $this->check('TEST5')->shouldBe(true);
 }
Exemple #2
0
 /**
  * Return string validator
  *
  * @return StringValidator
  */
 public function string()
 {
     return StringValidator::create();
 }