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.
74 $dataType = $this->f->alphanumeric(
'someValue');
75 $this->assertInstanceOf(Data\Alphanumeric::class, $dataType);
◆ testDataSize1()
| DataFactoryTest::testDataSize1 |
( |
| ) |
|
Definition at line 84 of file DataFactoryTest.php.
86 $dataType = $this->f->dataSize(10,
"MB");
87 $this->assertInstanceOf(Data\DataSize::class, $dataType);
◆ testDataSize2()
| DataFactoryTest::testDataSize2 |
( |
| ) |
|
Definition at line 90 of file DataFactoryTest.php.
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);
◆ testError()
| DataFactoryTest::testError |
( |
| ) |
|
Definition at line 58 of file DataFactoryTest.php.
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());
◆ testLanguageTag()
| DataFactoryTest::testLanguageTag |
( |
| ) |
|
Definition at line 99 of file DataFactoryTest.php.
101 $tag = $this->f->languageTag(
'de');
102 $this->assertInstanceOf(LanguageTag::class, $tag);
◆ testLanguageTagFailed()
| DataFactoryTest::testLanguageTagFailed |
( |
| ) |
|
Definition at line 105 of file DataFactoryTest.php.
107 $this->expectException(NotOKException::class);
108 $this->f->languageTag(
'd$');
◆ testOk()
| DataFactoryTest::testOk |
( |
| ) |
|
Definition at line 50 of file DataFactoryTest.php.
52 $result = $this->f->ok(3.154);
53 $this->assertInstanceOf(Data\Result::class, $result);
54 $this->assertTrue($result->isOk());
55 $this->assertFalse($result->isError());
◆ testPassword()
| DataFactoryTest::testPassword |
( |
| ) |
|
Definition at line 66 of file DataFactoryTest.php.
68 $pwd = $this->f->password(
"secret");
69 $this->assertInstanceOf(Data\Password::class, $pwd);
◆ testPositiveInteger()
| DataFactoryTest::testPositiveInteger |
( |
| ) |
|
Definition at line 78 of file DataFactoryTest.php.
80 $dataType = $this->f->positiveInteger(100);
81 $this->assertInstanceOf(Data\PositiveInteger::class, $dataType);
◆ $f
The documentation for this class was generated from the following file: