TestCase for the factory of constraints.
More...
◆ setUp()
ValidationFactoryTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 21 of file ValidationFactoryTest.php.
23 $this->lng = $this->createMock(\ilLanguage::class);
24 $this->f =
new Validation\Factory(
new Data\
Factory(), $this->lng);
◆ tearDown()
ValidationFactoryTest::tearDown |
( |
| ) |
|
|
protected |
◆ testCustom()
ValidationFactoryTest::testCustom |
( |
| ) |
|
Definition at line 62 of file ValidationFactoryTest.php.
64 $custom = $this->f->custom(
function ($value) {
65 return "This was fault";
67 $this->assertInstanceOf(Validation\Constraint::class, $custom);
◆ testGreaterThan()
ValidationFactoryTest::testGreaterThan |
( |
| ) |
|
Definition at line 44 of file ValidationFactoryTest.php.
46 $gt = $this->f->greaterThan(5);
47 $this->assertInstanceOf(Validation\Constraint::class, $gt);
◆ testHasMinLength()
ValidationFactoryTest::testHasMinLength |
( |
| ) |
|
Definition at line 56 of file ValidationFactoryTest.php.
58 $min = $this->f->hasMinLength(1);
59 $this->assertInstanceOf(Validation\Constraint::class, $min);
◆ testIsInt()
ValidationFactoryTest::testIsInt |
( |
| ) |
|
Definition at line 32 of file ValidationFactoryTest.php.
34 $is_numeric = $this->f->isNumeric();
35 $this->assertInstanceOf(Validation\Constraint::class, $is_numeric);
◆ testIsNumeric()
ValidationFactoryTest::testIsNumeric |
( |
| ) |
|
Definition at line 38 of file ValidationFactoryTest.php.
40 $is_int = $this->f->isInt();
41 $this->assertInstanceOf(Validation\Constraint::class, $is_int);
◆ testLessThan()
ValidationFactoryTest::testLessThan |
( |
| ) |
|
Definition at line 50 of file ValidationFactoryTest.php.
52 $lt = $this->f->lessThan(5);
53 $this->assertInstanceOf(Validation\Constraint::class, $lt);
◆ testLoadsLanguageModule()
ValidationFactoryTest::testLoadsLanguageModule |
( |
| ) |
|
Definition at line 99 of file ValidationFactoryTest.php.
References $lng, and Sabre\Event\once().
101 $lng = $this->createMock(\ilLanguage::class);
104 ->expects($this->
once())
105 ->method(
"loadLanguageModule")
106 ->with(Validation\Factory::LANGUAGE_MODULE);
once($eventName, callable $callBack, $priority=100)
Subscribe to an event exactly once.
◆ testNot()
ValidationFactoryTest::testNot |
( |
| ) |
|
Definition at line 92 of file ValidationFactoryTest.php.
94 $constraint = $this->f->greaterThan(5);
95 $not = $this->f->not($constraint);
96 $this->assertInstanceOf(Validation\Constraint::class, $not);
◆ testParallel()
ValidationFactoryTest::testParallel |
( |
| ) |
|
Definition at line 81 of file ValidationFactoryTest.php.
84 $this->f->greaterThan(5),
85 $this->f->lessThan(15)
88 $parallel = $this->f->parallel($constraints);
89 $this->assertInstanceOf(Validation\Constraint::class, $parallel);
◆ testSequential()
ValidationFactoryTest::testSequential |
( |
| ) |
|
Definition at line 70 of file ValidationFactoryTest.php.
73 $this->f->greaterThan(5),
74 $this->f->lessThan(15)
77 $sequential = $this->f->sequential($constraints);
78 $this->assertInstanceOf(Validation\Constraint::class, $sequential);
◆ $f
ValidationFactoryTest::$f = null |
|
protected |
The documentation for this class was generated from the following file: