mirror of
https://github.com/LibreSign/libresign.git
synced 2025-12-18 05:20:45 +01:00
fix: unit test
Signed-off-by: Vitor Mattos <vitor@php.rio>
This commit is contained in:
parent
c7375f081f
commit
d6e27710ee
1 changed files with 18 additions and 6 deletions
|
|
@ -42,7 +42,9 @@ final class SignFileControllerTest extends ApiTestCase {
|
|||
|
||||
$response = $this->assertRequest();
|
||||
$body = json_decode($response->getBody()->getContents(), true);
|
||||
$this->assertEquals('File not found', $body['ocs']['data']['errors'][0]);
|
||||
$this->assertCount(1, $body['ocs']['data']['errors']);
|
||||
$this->assertArrayHasKey(0, $body['ocs']['data']['errors']);
|
||||
$this->assertEquals('File not found', $body['ocs']['data']['errors'][0]['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -65,7 +67,9 @@ final class SignFileControllerTest extends ApiTestCase {
|
|||
|
||||
$response = $this->assertRequest();
|
||||
$body = json_decode($response->getBody()->getContents(), true);
|
||||
$this->assertEquals('Invalid UUID', $body['ocs']['data']['errors'][0]);
|
||||
$this->assertCount(1, $body['ocs']['data']['errors']);
|
||||
$this->assertArrayHasKey(0, $body['ocs']['data']['errors']);
|
||||
$this->assertEquals('Invalid UUID', $body['ocs']['data']['errors'][0]['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -107,7 +111,9 @@ final class SignFileControllerTest extends ApiTestCase {
|
|||
|
||||
$response = $this->assertRequest();
|
||||
$body = json_decode($response->getBody()->getContents(), true);
|
||||
$this->assertEquals('File already signed.', $body['ocs']['data']['errors'][0]);
|
||||
$this->assertCount(1, $body['ocs']['data']['errors']);
|
||||
$this->assertArrayHasKey(0, $body['ocs']['data']['errors']);
|
||||
$this->assertEquals('File already signed.', $body['ocs']['data']['errors'][0]['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -150,7 +156,9 @@ final class SignFileControllerTest extends ApiTestCase {
|
|||
|
||||
$response = $this->assertRequest();
|
||||
$body = json_decode($response->getBody()->getContents(), true);
|
||||
$this->assertEquals('File not found', $body['ocs']['data']['errors'][0]);
|
||||
$this->assertCount(1, $body['ocs']['data']['errors']);
|
||||
$this->assertArrayHasKey(0, $body['ocs']['data']['errors']);
|
||||
$this->assertEquals('File not found', $body['ocs']['data']['errors'][0]['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -190,7 +198,9 @@ final class SignFileControllerTest extends ApiTestCase {
|
|||
$response = $this->assertRequest();
|
||||
$body = json_decode($response->getBody()->getContents(), true);
|
||||
$this->assertEquals(200, $body['ocs']['data']['action']);
|
||||
$this->assertEquals('Empty identify data.', $body['ocs']['data']['errors'][0]);
|
||||
$this->assertCount(1, $body['ocs']['data']['errors']);
|
||||
$this->assertArrayHasKey(0, $body['ocs']['data']['errors']);
|
||||
$this->assertEquals('Empty identify data.', $body['ocs']['data']['errors'][0]['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -250,7 +260,9 @@ final class SignFileControllerTest extends ApiTestCase {
|
|||
|
||||
$response = $this->assertRequest();
|
||||
$body = json_decode($response->getBody()->getContents(), true);
|
||||
$this->assertEquals('Empty identify data.', $body['ocs']['data']['errors'][0]);
|
||||
$this->assertCount(1, $body['ocs']['data']['errors']);
|
||||
$this->assertArrayHasKey(0, $body['ocs']['data']['errors']);
|
||||
$this->assertEquals('Empty identify data.', $body['ocs']['data']['errors'][0]['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue