Testing the faytory of result objects.
More...
◆ setUp()
DataFactoryTest::setUp |
( |
| ) |
|
|
protected |
◆ tearDown()
DataFactoryTest::tearDown |
( |
| ) |
|
|
protected |
◆ testAlphanumeric()
DataFactoryTest::testAlphanumeric |
( |
| ) |
|
Definition at line 72 of file DataFactoryTest.php.
72 : void
73 {
74 $dataType = $this->f->alphanumeric('someValue');
75 $this->assertInstanceOf(
Data\Alphanumeric::class, $dataType);
76 }
◆ testDataSize1()
DataFactoryTest::testDataSize1 |
( |
| ) |
|
Definition at line 84 of file DataFactoryTest.php.
84 : void
85 {
86 $dataType = $this->f->dataSize(10, "MB");
87 $this->assertInstanceOf(
Data\DataSize::class, $dataType);
88 }
◆ testDataSize2()
DataFactoryTest::testDataSize2 |
( |
| ) |
|
Definition at line 90 of file DataFactoryTest.php.
90 : void
91 {
92 $dataType = $this->f->dataSize("10G");
93 $this->assertEquals(10, $dataType->getSize());
94 $this->assertEquals(
Data\DataSize::GiB, $dataType->getUnit());
95 $this->assertEquals(10 *
Data\DataSize::GiB, $dataType->inBytes());
96 $this->assertInstanceOf(
Data\DataSize::class, $dataType);
97 }
◆ testError()
DataFactoryTest::testError |
( |
| ) |
|
Definition at line 58 of file DataFactoryTest.php.
58 : void
59 {
60 $result = $this->f->error("Something went wrong");
61 $this->assertInstanceOf(
Data\Result::class, $result);
62 $this->assertTrue($result->isError());
63 $this->assertFalse($result->isOk());
64 }
◆ testLanguageTag()
DataFactoryTest::testLanguageTag |
( |
| ) |
|
Definition at line 99 of file DataFactoryTest.php.
99 : void
100 {
101 $tag = $this->f->languageTag('de');
102 $this->assertInstanceOf(LanguageTag::class, $tag);
103 }
◆ testLanguageTagFailed()
DataFactoryTest::testLanguageTagFailed |
( |
| ) |
|
Definition at line 105 of file DataFactoryTest.php.
105 : void
106 {
107 $this->expectException(NotOKException::class);
108 $this->f->languageTag('d$');
109 }
◆ testOk()
DataFactoryTest::testOk |
( |
| ) |
|
Definition at line 50 of file DataFactoryTest.php.
50 : void
51 {
52 $result = $this->f->ok(3.154);
53 $this->assertInstanceOf(
Data\Result::class, $result);
54 $this->assertTrue($result->isOk());
55 $this->assertFalse($result->isError());
56 }
◆ testPassword()
DataFactoryTest::testPassword |
( |
| ) |
|
Definition at line 66 of file DataFactoryTest.php.
66 : void
67 {
68 $pwd = $this->f->password("secret");
69 $this->assertInstanceOf(
Data\Password::class, $pwd);
70 }
◆ testPositiveInteger()
DataFactoryTest::testPositiveInteger |
( |
| ) |
|
Definition at line 78 of file DataFactoryTest.php.
78 : void
79 {
80 $dataType = $this->f->positiveInteger(100);
81 $this->assertInstanceOf(
Data\PositiveInteger::class, $dataType);
82 }
◆ $f
The documentation for this class was generated from the following file: