fix: unit test

Signed-off-by: Vitor Mattos <vitor@php.rio>
This commit is contained in:
Vitor Mattos 2025-05-12 15:32:58 -03:00
commit d6e27710ee
No known key found for this signature in database
GPG key ID: B7AB4B76A7CA7318

View file

@ -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']);
}
/**