17 $this->f =
new Validation\Factory(
new Data\
Factory());
27 $is_int = $this->f->isInt();
28 $this->assertInstanceOf(Validation\Constraint::class, $is_int);
33 $gt = $this->f->greaterThan(5);
34 $this->assertInstanceOf(Validation\Constraint::class, $gt);
39 $lt = $this->f->lessThan(5);
40 $this->assertInstanceOf(Validation\Constraint::class, $lt);
45 $custom = $this->f->custom(
function ($value) {
46 return "This was fault";
48 $this->assertInstanceOf(Validation\Constraint::class, $custom);
54 $this->f->greaterThan(5),
55 $this->f->lessThan(15)
58 $sequential = $this->f->sequential($constraints);
59 $this->assertInstanceOf(Validation\Constraint::class, $sequential);
65 $this->f->greaterThan(5),
66 $this->f->lessThan(15)
69 $parallel = $this->f->parallel($constraints);
70 $this->assertInstanceOf(Validation\Constraint::class, $parallel);
75 $constraint = $this->f->greaterThan(5);
76 $not = $this->f->not($constraint);
77 $this->assertInstanceOf(Validation\Constraint::class, $not);
Create styles array
The data for the language used.
TestCase for the factory of constraints.