test invalid pdf params
This commit is contained in:
parent
8c8ee4c050
commit
d48c854e42
2 changed files with 28 additions and 6 deletions
|
|
@ -278,6 +278,17 @@ class ElementControllerTest extends TestCase
|
|||
);
|
||||
}
|
||||
|
||||
public function testShowPdfReturns400WhenFolderIsInvalid(): void
|
||||
{
|
||||
$response = $this->controller->showPdf('archive', 'baderech.pdf');
|
||||
|
||||
$this->assertEquals(400, $response->getStatusCode());
|
||||
$this->assertSame(
|
||||
['error' => 'folder is invalid'],
|
||||
json_decode($response->getContent(), true),
|
||||
);
|
||||
}
|
||||
|
||||
public function testShowPdfReturns400WhenFolderIsMissing(): void
|
||||
{
|
||||
$response = $this->controller->showPdf(null, 'baderech.pdf');
|
||||
|
|
@ -289,6 +300,17 @@ class ElementControllerTest extends TestCase
|
|||
);
|
||||
}
|
||||
|
||||
public function testShowPdfReturns400WhenFileNameIsInvalid(): void
|
||||
{
|
||||
$response = $this->controller->showPdf('short', '../baderech.pdf');
|
||||
|
||||
$this->assertEquals(400, $response->getStatusCode());
|
||||
$this->assertSame(
|
||||
['error' => 'fileName is invalid'],
|
||||
json_decode($response->getContent(), true),
|
||||
);
|
||||
}
|
||||
|
||||
public function testShowPdfReturns400WhenFileNameIsMissing(): void
|
||||
{
|
||||
$response = $this->controller->showPdf('short', null);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue