ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ValidationFactoryTest Class Reference

TestCase for the factory of constraints. More...

+ Inheritance diagram for ValidationFactoryTest:
+ Collaboration diagram for ValidationFactoryTest:

Public Member Functions

 testIsInt ()
 
 testGreaterThan ()
 
 testLessThan ()
 
 testCustom ()
 
 testSequential ()
 
 testParallel ()
 
 testNot ()
 

Protected Member Functions

 setUp ()
 
 tearDown ()
 

Detailed Description

TestCase for the factory of constraints.

Author
Stefan Hecken stefa.nosp@m.n.he.nosp@m.cken@.nosp@m.conc.nosp@m.epts-.nosp@m.and-.nosp@m.train.nosp@m.ing..nosp@m.de

Definition at line 13 of file ValidationFactoryTest.php.

Member Function Documentation

◆ setUp()

ValidationFactoryTest::setUp ( )
protected

Definition at line 15 of file ValidationFactoryTest.php.

16  {
17  $this->f = new Validation\Factory(new Data\Factory());
18  }
Builds data types.
Definition: Factory.php:14

◆ tearDown()

ValidationFactoryTest::tearDown ( )
protected

Definition at line 20 of file ValidationFactoryTest.php.

21  {
22  $this->f = null;
23  }

◆ testCustom()

ValidationFactoryTest::testCustom ( )

Definition at line 43 of file ValidationFactoryTest.php.

44  {
45  $custom = $this->f->custom(function ($value) {
46  return "This was fault";
47  }, 5);
48  $this->assertInstanceOf(Validation\Constraint::class, $custom);
49  }

◆ testGreaterThan()

ValidationFactoryTest::testGreaterThan ( )

Definition at line 31 of file ValidationFactoryTest.php.

32  {
33  $gt = $this->f->greaterThan(5);
34  $this->assertInstanceOf(Validation\Constraint::class, $gt);
35  }

◆ testIsInt()

ValidationFactoryTest::testIsInt ( )

Definition at line 25 of file ValidationFactoryTest.php.

26  {
27  $is_int = $this->f->isInt();
28  $this->assertInstanceOf(Validation\Constraint::class, $is_int);
29  }

◆ testLessThan()

ValidationFactoryTest::testLessThan ( )

Definition at line 37 of file ValidationFactoryTest.php.

38  {
39  $lt = $this->f->lessThan(5);
40  $this->assertInstanceOf(Validation\Constraint::class, $lt);
41  }

◆ testNot()

ValidationFactoryTest::testNot ( )

Definition at line 73 of file ValidationFactoryTest.php.

74  {
75  $constraint = $this->f->greaterThan(5);
76  $not = $this->f->not($constraint);
77  $this->assertInstanceOf(Validation\Constraint::class, $not);
78  }

◆ testParallel()

ValidationFactoryTest::testParallel ( )

Definition at line 62 of file ValidationFactoryTest.php.

References array.

63  {
64  $constraints = array(
65  $this->f->greaterThan(5),
66  $this->f->lessThan(15)
67  );
68 
69  $parallel = $this->f->parallel($constraints);
70  $this->assertInstanceOf(Validation\Constraint::class, $parallel);
71  }
Create styles array
The data for the language used.

◆ testSequential()

ValidationFactoryTest::testSequential ( )

Definition at line 51 of file ValidationFactoryTest.php.

References array.

52  {
53  $constraints = array(
54  $this->f->greaterThan(5),
55  $this->f->lessThan(15)
56  );
57 
58  $sequential = $this->f->sequential($constraints);
59  $this->assertInstanceOf(Validation\Constraint::class, $sequential);
60  }
Create styles array
The data for the language used.

The documentation for this class was generated from the following file: