TestCase for the factory of constraints.
More...
|
| testAccept ($constraint, $ok_value, $error_value) |
| constraintsProvider More...
|
|
| testCheck ($constraint, $ok_value, $error_value) |
| constraintsProvider More...
|
|
| testProblemWith ($constraint, $ok_value, $error_value) |
| constraintsProvider More...
|
|
| testRestrict ($constraint, $ok_value, $error_value) |
| constraintsProvider More...
|
|
| testWithProblemBuilder ($constraint, $ok_value, $error_value) |
| constraintsProvider More...
|
|
| constraintsProvider () |
|
◆ constraintsProvider()
NotTest::constraintsProvider |
( |
| ) |
|
Definition at line 89 of file NotTest.php.
References array.
91 $f =
new Validation\Factory(
new Data\
Factory());
93 return array(
array($f->not($f->isInt()), 2, 2.2),
94 array($f->not($f->greaterThan(5)), 6, 4),
95 array($f->not($f->lessThan(5)), 4, 6)
Create styles array
The data for the language used.
◆ testAccept()
NotTest::testAccept |
( |
|
$constraint, |
|
|
|
$ok_value, |
|
|
|
$error_value |
|
) |
| |
constraintsProvider
Definition at line 18 of file NotTest.php.
20 $this->assertFalse($constraint->accepts($ok_value));
21 $this->assertTrue($constraint->accepts($error_value));
◆ testCheck()
NotTest::testCheck |
( |
|
$constraint, |
|
|
|
$ok_value, |
|
|
|
$error_value |
|
) |
| |
constraintsProvider
Definition at line 27 of file NotTest.php.
32 $constraint->check($ok_value);
37 $this->assertTrue($raised);
40 $constraint->check($error_value);
46 $this->assertFalse($raised);
◆ testProblemWith()
NotTest::testProblemWith |
( |
|
$constraint, |
|
|
|
$ok_value, |
|
|
|
$error_value |
|
) |
| |
constraintsProvider
Definition at line 52 of file NotTest.php.
54 $this->assertNull($constraint->problemWith($error_value));
55 $this->assertInternalType(
"string", $constraint->problemWith($ok_value));
◆ testRestrict()
NotTest::testRestrict |
( |
|
$constraint, |
|
|
|
$ok_value, |
|
|
|
$error_value |
|
) |
| |
constraintsProvider
Definition at line 61 of file NotTest.php.
References $error, $ok, and $result.
63 $rf =
new Data\Factory();
64 $ok = $rf->ok($error_value);
65 $ok2 = $rf->ok($ok_value);
66 $error = $rf->error(
"text");
69 $this->assertTrue(
$result->isOk());
71 $result = $constraint->restrict($ok2);
72 $this->assertTrue($result->isError());
74 $result = $constraint->restrict(
$error);
75 $this->assertSame(
$error, $result);
◆ testWithProblemBuilder()
NotTest::testWithProblemBuilder |
( |
|
$constraint, |
|
|
|
$ok_value, |
|
|
|
$error_value |
|
) |
| |
constraintsProvider
Definition at line 81 of file NotTest.php.
83 $new_constraint = $constraint->withProblemBuilder(
function () {
84 return "This was a vault";
86 $this->assertEquals(
"This was a vault", $new_constraint->problemWith($ok_value));
The documentation for this class was generated from the following file: