Testing the faytory of result objects.
More...
◆ setUp()
| DataFactoryTest::setUp |
( |
| ) |
|
|
protected |
◆ tearDown()
| DataFactoryTest::tearDown |
( |
| ) |
|
|
protected |
◆ testAlphanumeric()
| DataFactoryTest::testAlphanumeric |
( |
| ) |
|
Definition at line 56 of file DataFactoryTest.php.
56 : void
57 {
58 $dataType = $this->f->alphanumeric('someValue');
59 $this->assertInstanceOf(Data\Alphanumeric::class, $dataType);
60 }
◆ testDataSize1()
| DataFactoryTest::testDataSize1 |
( |
| ) |
|
Definition at line 68 of file DataFactoryTest.php.
68 : void
69 {
70 $dataType = $this->f->dataSize(10, "MB");
71 $this->assertInstanceOf(Data\DataSize::class, $dataType);
72 }
◆ testDataSize2()
| DataFactoryTest::testDataSize2 |
( |
| ) |
|
Definition at line 74 of file DataFactoryTest.php.
74 : void
75 {
76 $dataType = $this->f->dataSize("10G");
77 $this->assertEquals(10, $dataType->getSize());
78 $this->assertEquals(Data\DataSize::GiB, $dataType->getUnit());
79 $this->assertEquals(10 * Data\DataSize::GiB, $dataType->inBytes());
80 $this->assertInstanceOf(Data\DataSize::class, $dataType);
81 }
◆ testError()
| DataFactoryTest::testError |
( |
| ) |
|
Definition at line 42 of file DataFactoryTest.php.
42 : void
43 {
44 $result = $this->f->error("Something went wrong");
45 $this->assertInstanceOf(Data\Result::class, $result);
46 $this->assertTrue($result->isError());
47 $this->assertFalse($result->isOk());
48 }
◆ testOk()
| DataFactoryTest::testOk |
( |
| ) |
|
Definition at line 34 of file DataFactoryTest.php.
34 : void
35 {
36 $result = $this->f->ok(3.154);
37 $this->assertInstanceOf(Data\Result::class, $result);
38 $this->assertTrue($result->isOk());
39 $this->assertFalse($result->isError());
40 }
◆ testPassword()
| DataFactoryTest::testPassword |
( |
| ) |
|
Definition at line 50 of file DataFactoryTest.php.
50 : void
51 {
52 $pwd = $this->f->password("secret");
53 $this->assertInstanceOf(Data\Password::class, $pwd);
54 }
◆ testPositiveInteger()
| DataFactoryTest::testPositiveInteger |
( |
| ) |
|
Definition at line 62 of file DataFactoryTest.php.
62 : void
63 {
64 $dataType = $this->f->positiveInteger(100);
65 $this->assertInstanceOf(Data\PositiveInteger::class, $dataType);
66 }
◆ $f
The documentation for this class was generated from the following file: