TestCase for the factory of constraints.
More...
◆ setUp()
◆ tearDown()
ParallelTest::tearDown |
( |
| ) |
|
|
protected |
◆ testAccept()
ParallelTest::testAccept |
( |
| ) |
|
Definition at line 25 of file ParallelTest.php.
References array.
27 $constraint = $this->f->parallel(
array($this->f->isInt(), $this->f->greaterThan(3), $this->f->lessThan(5)));
29 $this->assertTrue($constraint->accepts(4));
30 $this->assertFalse($constraint->accepts(2));
Create styles array
The data for the language used.
◆ testCheck()
ParallelTest::testCheck |
( |
| ) |
|
Definition at line 33 of file ParallelTest.php.
References array.
35 $constraint = $this->f->sequential(
array($this->f->isInt(), $this->f->greaterThan(3), $this->f->lessThan(5)));
39 $constraint->check(4);
44 $this->assertFalse($raised);
46 $constraint = $this->f->parallel(
array($this->f->isInt(), $this->f->greaterThan(3), $this->f->lessThan(1)));
48 $constraint->check(2);
51 $this->assertEquals(
"'2' is not greater than '3'.'2' is greater than '1'.", $e->getMessage());
55 $this->assertTrue($raised);
Create styles array
The data for the language used.
◆ testCorrectErrorMessagesAfterMultiAccept()
ParallelTest::testCorrectErrorMessagesAfterMultiAccept |
( |
| ) |
|
Definition at line 98 of file ParallelTest.php.
References array.
100 $constraint = $this->f->parallel(
array($this->f->isInt(), $this->f->greaterThan(3), $this->f->lessThan(2)));
101 $constraint->accepts(1);
102 $constraint->accepts(3);
103 $constraint->accepts(4);
105 $this->assertEquals(
"'1' is not greater than '3'.", $constraint->problemWith(1));
106 $this->assertEquals(
"'3' is not greater than '3'.'3' is greater than '2'.", $constraint->problemWith(3));
107 $this->assertEquals(
"'4' is greater than '2'.", $constraint->problemWith(4));
Create styles array
The data for the language used.
◆ testProblemWith()
ParallelTest::testProblemWith |
( |
| ) |
|
Definition at line 58 of file ParallelTest.php.
References array.
60 $constraint = $this->f->parallel(
array($this->f->isInt(), $this->f->greaterThan(3), $this->f->lessThan(5)));
62 $this->assertNull($constraint->problemWith(4));
64 $constraint = $this->f->parallel(
array($this->f->isInt(), $this->f->greaterThan(3), $this->f->lessThan(1)));
65 $this->assertInternalType(
"string", $constraint->problemWith(2));
66 $this->assertEquals(
"'2' is not greater than '3'.'2' is greater than '1'.", $constraint->problemWith(2));
Create styles array
The data for the language used.
◆ testRestrict()
ParallelTest::testRestrict |
( |
| ) |
|
Definition at line 69 of file ParallelTest.php.
References $error, $ok, $result, and array.
71 $constraint = $this->f->parallel(
array($this->f->isInt(), $this->f->greaterThan(3), $this->f->lessThan(5)));
73 $rf =
new Data\Factory();
76 $error = $rf->error(
"text");
79 $this->assertTrue(
$result->isOk());
81 $result = $constraint->restrict($ok2);
82 $this->assertTrue($result->isError());
84 $result = $constraint->restrict(
$error);
85 $this->assertSame(
$error, $result);
Create styles array
The data for the language used.
◆ testWithProblemBuilder()
ParallelTest::testWithProblemBuilder |
( |
| ) |
|
Definition at line 88 of file ParallelTest.php.
References array.
90 $constraint = $this->f->parallel(
array($this->f->isInt(), $this->f->greaterThan(3), $this->f->lessThan(1)));
92 $new_constraint = $constraint->withProblemBuilder(
function () {
93 return "This was a vault";
95 $this->assertEquals(
"This was a vault", $new_constraint->problemWith(2));
Create styles array
The data for the language used.
The documentation for this class was generated from the following file: