|
@@ 22-28 (lines=7) @@
|
| 19 |
|
$this->assertEquals(400, JSend::getDefaultHttpStatusCode(ResponseFactory::instance()->error(['message' => 'wtf', 'code' => 400]))); |
| 20 |
|
} |
| 21 |
|
|
| 22 |
|
public function testSuccessFactory(): void |
| 23 |
|
{ |
| 24 |
|
$response = JSendResponse::success(['Erfolgreich!']); |
| 25 |
|
|
| 26 |
|
$this->assertTrue($response->getStatus()->isSuccess()); |
| 27 |
|
$this->assertEquals(['Erfolgreich!'], $response->getData()); |
| 28 |
|
} |
| 29 |
|
|
| 30 |
|
public function testFailFactory(): void |
| 31 |
|
{ |
|
@@ 30-36 (lines=7) @@
|
| 27 |
|
$this->assertEquals(['Erfolgreich!'], $response->getData()); |
| 28 |
|
} |
| 29 |
|
|
| 30 |
|
public function testFailFactory(): void |
| 31 |
|
{ |
| 32 |
|
$response = JSendResponse::fail(['Irgendwas lief schief']); |
| 33 |
|
|
| 34 |
|
$this->assertTrue($response->getStatus()->isFail()); |
| 35 |
|
$this->assertEquals(['Irgendwas lief schief'], $response->getData()); |
| 36 |
|
} |
| 37 |
|
|
| 38 |
|
public function testErrorFactory(): void |
| 39 |
|
{ |