Release 2.0.15 (#3970)
This commit is contained in:
@@ -49,38 +49,44 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
return $this->importFixture($fixture);
|
||||
}
|
||||
|
||||
public function testIsSecure()
|
||||
public function testIsSecure(): void
|
||||
{
|
||||
$this->assertUrlIsSecured('/api/timesheets');
|
||||
}
|
||||
|
||||
public function testGetCollection()
|
||||
public function testGetCollection(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->importFixtureForUser(User::ROLE_USER);
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets');
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertEquals(10, \count($result));
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertNotEmpty($result);
|
||||
self::assertEquals(10, \count($result));
|
||||
self::assertApiResponseTypeStructure('TimesheetCollection', $result[0]);
|
||||
}
|
||||
|
||||
public function testGetCollectionFull()
|
||||
public function testGetCollectionFull(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->importFixtureForUser(User::ROLE_USER);
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets', 'GET', ['full' => 'true']);
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertEquals(10, \count($result));
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertNotEmpty($result);
|
||||
self::assertEquals(10, \count($result));
|
||||
self::assertApiResponseTypeStructure('TimesheetCollectionFull', $result[0]);
|
||||
}
|
||||
|
||||
public function testGetCollectionForOtherUser()
|
||||
public function testGetCollectionForOtherUser(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
|
||||
$this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -97,15 +103,30 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
|
||||
$query = ['user' => 2];
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets', 'GET', $query);
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertEquals(10, \count($result));
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertNotEmpty($result);
|
||||
self::assertEquals(10, \count($result));
|
||||
self::assertApiResponseTypeStructure('TimesheetCollection', $result[0]);
|
||||
|
||||
$query = ['users' => [2]];
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets', 'GET', $query);
|
||||
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertNotEmpty($result);
|
||||
self::assertEquals(10, \count($result));
|
||||
self::assertApiResponseTypeStructure('TimesheetCollection', $result[0]);
|
||||
}
|
||||
|
||||
public function testGetCollectionForAllUser()
|
||||
public function testGetCollectionForAllUser(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
|
||||
$this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -122,26 +143,32 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
|
||||
$query = ['user' => 'all'];
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets', 'GET', $query);
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertEquals(17, \count($result));
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertNotEmpty($result);
|
||||
self::assertEquals(17, \count($result));
|
||||
self::assertApiResponseTypeStructure('TimesheetCollection', $result[0]);
|
||||
}
|
||||
|
||||
public function testGetCollectionForEmptyResult()
|
||||
public function testGetCollectionForEmptyResult(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
|
||||
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets');
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
$this->assertEmpty($result);
|
||||
}
|
||||
|
||||
public function testGetCollectionWithQuery()
|
||||
public function testGetCollectionWithQuery(): void
|
||||
{
|
||||
$modifiedAfter = new \DateTime('-1 hour');
|
||||
$begin = new \DateTime('first day of this month');
|
||||
@@ -167,16 +194,18 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->importFixtureForUser(User::ROLE_USER, 22);
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets', 'GET', $query);
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
$this->assertPagination($client->getResponse(), 2, 4, 6, 22);
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertEquals(4, \count($result));
|
||||
self::assertIsArray($result);
|
||||
self::assertNotEmpty($result);
|
||||
self::assertEquals(4, \count($result));
|
||||
self::assertApiResponseTypeStructure('TimesheetCollection', $result[0]);
|
||||
}
|
||||
|
||||
public function testGetCollectionWithQueryFailsWith404OnOutOfRangedPage()
|
||||
public function testGetCollectionWithQueryFailsWith404OnOutOfRangedPage(): void
|
||||
{
|
||||
$begin = new \DateTime('first day of this month');
|
||||
$begin->setTime(0, 0, 0);
|
||||
@@ -194,7 +223,7 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->assertApiException($client->getResponse(), ['code' => 404, 'message' => 'Not Found']);
|
||||
}
|
||||
|
||||
public function testGetCollectionWithSingleParamsQuery()
|
||||
public function testGetCollectionWithSingleParamsQuery(): void
|
||||
{
|
||||
$begin = new \DateTime('first day of this month');
|
||||
$begin->setTime(0, 0, 0);
|
||||
@@ -218,15 +247,17 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->importFixtureForUser(User::ROLE_USER);
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets', 'GET', $query);
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertEquals(5, \count($result));
|
||||
self::assertIsArray($result);
|
||||
self::assertNotEmpty($result);
|
||||
self::assertEquals(5, \count($result));
|
||||
self::assertApiResponseTypeStructure('TimesheetCollection', $result[0]);
|
||||
}
|
||||
|
||||
public function testExportedFilter()
|
||||
public function testExportedFilter(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -255,11 +286,13 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
];
|
||||
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets', 'GET', $query);
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertEquals(7, \count($result));
|
||||
self::assertIsArray($result);
|
||||
self::assertNotEmpty($result);
|
||||
self::assertEquals(7, \count($result));
|
||||
self::assertApiResponseTypeStructure('TimesheetCollection', $result[0]);
|
||||
|
||||
$query = [
|
||||
@@ -271,11 +304,13 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
];
|
||||
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets', 'GET', $query);
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertEquals(10, \count($result));
|
||||
self::assertIsArray($result);
|
||||
self::assertNotEmpty($result);
|
||||
self::assertEquals(10, \count($result));
|
||||
self::assertApiResponseTypeStructure('TimesheetCollection', $result[0]);
|
||||
|
||||
$query = [
|
||||
@@ -285,15 +320,17 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
'end' => $end->format(self::DATE_FORMAT_HTML5),
|
||||
];
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets', 'GET', $query);
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertEquals(17, \count($result));
|
||||
self::assertIsArray($result);
|
||||
self::assertNotEmpty($result);
|
||||
self::assertEquals(17, \count($result));
|
||||
self::assertApiResponseTypeStructure('TimesheetCollection', $result[0]);
|
||||
}
|
||||
|
||||
public function testGetEntity()
|
||||
public function testGetEntity(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$em = $this->getEntityManager();
|
||||
@@ -323,9 +360,11 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$em->flush();
|
||||
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets/' . $timesheet->getId());
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
self::assertIsArray($result);
|
||||
self::assertApiResponseTypeStructure('TimesheetEntity', $result);
|
||||
|
||||
$expected = [
|
||||
@@ -353,7 +392,7 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
}
|
||||
}
|
||||
|
||||
public function testGetEntityAccessDenied()
|
||||
public function testGetEntityAccessDenied(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -363,23 +402,25 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->assertApiAccessDenied($client, '/api/timesheets/' . $timesheets[0]->getId(), 'Access denied.');
|
||||
}
|
||||
|
||||
public function testGetEntityAccessAllowedForAdmin()
|
||||
public function testGetEntityAccessAllowedForAdmin(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$timesheets = $this->importFixtureForUser(User::ROLE_USER);
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets/' . $timesheets[0]->getId());
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
self::assertIsArray($result);
|
||||
self::assertApiResponseTypeStructure('TimesheetEntity', $result);
|
||||
}
|
||||
|
||||
public function testGetEntityNotFound()
|
||||
public function testGetEntityNotFound(): void
|
||||
{
|
||||
$this->assertEntityNotFound(User::ROLE_USER, '/api/timesheets/' . PHP_INT_MAX, 'GET', 'App\\Entity\\Timesheet object not found by the @ParamConverter annotation.');
|
||||
}
|
||||
|
||||
public function testPostAction()
|
||||
public function testPostAction(): void
|
||||
{
|
||||
$dateTime = new DateTimeFactory(new \DateTimeZone(self::TEST_TIMEZONE));
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
@@ -396,16 +437,19 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->request($client, '/api/timesheets', 'POST', [], json_encode($data));
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$this->assertIsArray($result);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertApiResponseTypeStructure('TimesheetEntity', $result);
|
||||
$this->assertNotEmpty($result['id']);
|
||||
self::assertNotEmpty($result['id']);
|
||||
$this->assertTrue($result['duration'] == 28800 || $result['duration'] == 28860); // 1 minute rounding might be applied
|
||||
$this->assertEquals(2016, $result['rate']);
|
||||
self::assertEquals(2016, $result['rate']);
|
||||
$this->assertFalse($result['billable']);
|
||||
}
|
||||
|
||||
public function testPostActionWithFullExpandedResponse()
|
||||
public function testPostActionWithFullExpandedResponse(): void
|
||||
{
|
||||
$dateTime = new DateTimeFactory(new \DateTimeZone(self::TEST_TIMEZONE));
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
@@ -422,16 +466,19 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->request($client, '/api/timesheets?full=true', 'POST', [], json_encode($data));
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$this->assertIsArray($result);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertApiResponseTypeStructure('TimesheetExpanded', $result);
|
||||
$this->assertNotEmpty($result['id']);
|
||||
self::assertNotEmpty($result['id']);
|
||||
$this->assertTrue($result['duration'] == 28800 || $result['duration'] == 28860); // 1 minute rounding might be applied
|
||||
$this->assertEquals(2016, $result['rate']);
|
||||
self::assertEquals(2016, $result['rate']);
|
||||
$this->assertTrue($result['billable']);
|
||||
}
|
||||
|
||||
public function testPostActionForDifferentUser()
|
||||
public function testPostActionForDifferentUser(): void
|
||||
{
|
||||
$dateTime = new DateTimeFactory(new \DateTimeZone(self::TEST_TIMEZONE));
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
@@ -451,18 +498,21 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->request($client, '/api/timesheets', 'POST', [], json_encode($data));
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$this->assertIsArray($result);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertApiResponseTypeStructure('TimesheetEntity', $result);
|
||||
$this->assertNotEmpty($result['id']);
|
||||
$this->assertEquals($user->getId(), $result['user']);
|
||||
self::assertNotEmpty($result['id']);
|
||||
self::assertEquals($user->getId(), $result['user']);
|
||||
$this->assertNotEquals($admin->getId(), $result['user']);
|
||||
$this->assertTrue($result['billable']);
|
||||
}
|
||||
|
||||
// check for project, as this is a required field. It will not be included in the select, as it is
|
||||
// already filtered within the repository due to the hidden customer
|
||||
public function testPostActionWithInvisibleProject()
|
||||
public function testPostActionWithInvisibleProject(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
|
||||
@@ -496,7 +546,7 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
|
||||
// check for activity, as this is a required field. It will not be included in the select, as it is
|
||||
// already filtered within the repository due to the hidden flag
|
||||
public function testPostActionWithInvisibleActivity()
|
||||
public function testPostActionWithInvisibleActivity(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
|
||||
@@ -528,7 +578,7 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->assertApiCallValidationError($client->getResponse(), ['activity']);
|
||||
}
|
||||
|
||||
public function testPostActionWithNonBillableCustomer()
|
||||
public function testPostActionWithNonBillableCustomer(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
|
||||
|
||||
@@ -557,13 +607,16 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->request($client, '/api/timesheets', 'POST', [], json_encode($data));
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$this->assertIsArray($result);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertApiResponseTypeStructure('TimesheetEntity', $result);
|
||||
$this->assertFalse($result['billable']);
|
||||
}
|
||||
|
||||
public function testPostActionWithNonBillableCustomerExplicit()
|
||||
public function testPostActionWithNonBillableCustomerExplicit(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
|
||||
|
||||
@@ -593,14 +646,17 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->request($client, '/api/timesheets', 'POST', [], json_encode($data));
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$this->assertIsArray($result);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertApiResponseTypeStructure('TimesheetEntity', $result);
|
||||
// explicit overwritten values win!
|
||||
$this->assertTrue($result['billable']);
|
||||
}
|
||||
|
||||
public function testPatchAction()
|
||||
public function testPatchAction(): void
|
||||
{
|
||||
$dateTime = new DateTimeFactory(new \DateTimeZone(self::TEST_TIMEZONE));
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_TEAMLEAD);
|
||||
@@ -616,16 +672,19 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->request($client, '/api/timesheets/' . $timesheets[0]->getId(), 'PATCH', [], json_encode($data));
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$this->assertIsArray($result);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertApiResponseTypeStructure('TimesheetEntity', $result);
|
||||
$this->assertNotEmpty($result['id']);
|
||||
$this->assertEquals(25200, $result['duration']);
|
||||
$this->assertEquals('foo', $result['description']);
|
||||
self::assertNotEmpty($result['id']);
|
||||
self::assertEquals(25200, $result['duration']);
|
||||
self::assertEquals('foo', $result['description']);
|
||||
$this->assertFalse($result['billable']);
|
||||
}
|
||||
|
||||
public function testPatchActionWithInvalidUser()
|
||||
public function testPatchActionWithInvalidUser(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -654,12 +713,12 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->assertApiResponseAccessDenied($response);
|
||||
}
|
||||
|
||||
public function testPatchActionWithUnknownTimesheet()
|
||||
public function testPatchActionWithUnknownTimesheet(): void
|
||||
{
|
||||
$this->assertEntityNotFoundForPatch(User::ROLE_USER, '/api/timesheets/255', []);
|
||||
}
|
||||
|
||||
public function testInvalidPatchAction()
|
||||
public function testInvalidPatchAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$timesheets = $this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -674,48 +733,51 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->request($client, '/api/timesheets/' . $timesheets[0]->getId(), 'PATCH', [], json_encode($data));
|
||||
|
||||
$response = $client->getResponse();
|
||||
$this->assertEquals(400, $response->getStatusCode());
|
||||
self::assertEquals(400, $response->getStatusCode());
|
||||
$this->assertApiCallValidationError($response, ['activity'], false, ['End date must not be earlier then start date.']);
|
||||
}
|
||||
|
||||
// TODO: TEST PATCH FOR EXPORTED TIMESHEET FOR USER WITHOUT PERMISSION IS REJECTED
|
||||
|
||||
public function testDeleteAction()
|
||||
public function testDeleteAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$timesheets = $this->importFixtureForUser(User::ROLE_USER);
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets/' . $timesheets[0]->getId());
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertApiResponseTypeStructure('TimesheetEntity', $result);
|
||||
$this->assertNotEmpty($result['id']);
|
||||
self::assertNotEmpty($result['id']);
|
||||
$id = $result['id'];
|
||||
|
||||
$this->request($client, '/api/timesheets/' . $id, 'DELETE');
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
$this->assertEquals(Response::HTTP_NO_CONTENT, $client->getResponse()->getStatusCode());
|
||||
self::assertEquals(Response::HTTP_NO_CONTENT, $client->getResponse()->getStatusCode());
|
||||
$this->assertEmpty($client->getResponse()->getContent());
|
||||
}
|
||||
|
||||
public function testDeleteActionWithUnknownTimesheet()
|
||||
public function testDeleteActionWithUnknownTimesheet(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$this->assertNotFoundForDelete($client, '/api/timesheets/255');
|
||||
}
|
||||
|
||||
public function testDeleteActionForDifferentUser()
|
||||
public function testDeleteActionForDifferentUser(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$timesheets = $this->importFixtureForUser(User::ROLE_USER);
|
||||
|
||||
$this->request($client, '/api/timesheets/' . $timesheets[0]->getId(), 'DELETE');
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
$this->assertEquals(Response::HTTP_NO_CONTENT, $client->getResponse()->getStatusCode());
|
||||
self::assertEquals(Response::HTTP_NO_CONTENT, $client->getResponse()->getStatusCode());
|
||||
$this->assertEmpty($client->getResponse()->getContent());
|
||||
}
|
||||
|
||||
public function testDeleteActionWithoutAuthorization()
|
||||
public function testDeleteActionWithoutAuthorization(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -727,7 +789,7 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->assertApiResponseAccessDenied($response);
|
||||
}
|
||||
|
||||
public function testDeleteActionForExportedRecordIsNotAllowed()
|
||||
public function testDeleteActionForExportedRecordIsNotAllowed(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -746,7 +808,7 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->assertApiResponseAccessDenied($response);
|
||||
}
|
||||
|
||||
public function testDeleteActionForExportedRecordIsAllowedForAdmin()
|
||||
public function testDeleteActionForExportedRecordIsAllowedForAdmin(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -763,7 +825,7 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
}
|
||||
|
||||
public function testGetRecentAction()
|
||||
public function testGetRecentAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
|
||||
@@ -785,15 +847,18 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
];
|
||||
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets/recent', 'GET', $query);
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertEquals(1, \count($result));
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertNotEmpty($result);
|
||||
self::assertEquals(1, \count($result));
|
||||
self::assertApiResponseTypeStructure('TimesheetCollectionFull', $result[0]);
|
||||
}
|
||||
|
||||
public function testActiveAction()
|
||||
public function testActiveAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
|
||||
@@ -813,14 +878,17 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->request($client, '/api/timesheets/active');
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
$results = json_decode($client->getResponse()->getContent(), true);
|
||||
$this->assertEquals(3, \count($results));
|
||||
foreach ($results as $timesheet) {
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertEquals(3, \count($result));
|
||||
foreach ($result as $timesheet) {
|
||||
self::assertApiResponseTypeStructure('TimesheetCollectionFull', $timesheet);
|
||||
}
|
||||
}
|
||||
|
||||
public function testStopAction()
|
||||
public function testStopAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -842,9 +910,12 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->request($client, '/api/timesheets/' . $id . '/stop', 'PATCH');
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertNotEmpty($result);
|
||||
self::assertApiResponseTypeStructure('TimesheetEntity', $result);
|
||||
|
||||
$em = $this->getEntityManager();
|
||||
@@ -853,7 +924,7 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->assertInstanceOf(\DateTime::class, $timesheet->getEnd());
|
||||
}
|
||||
|
||||
public function testStopActionTriggersValidationOnLongRunning()
|
||||
public function testStopActionTriggersValidationOnLongRunning(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->setSystemConfiguration('timesheet.rules.long_running_duration', 750);
|
||||
@@ -877,12 +948,12 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->assertApiCallValidationError($client->getResponse(), ['duration' => 'Maximum 12:30 hours allowed.']);
|
||||
}
|
||||
|
||||
public function testStopThrowsNotFound()
|
||||
public function testStopThrowsNotFound(): void
|
||||
{
|
||||
$this->assertEntityNotFoundForPatch(User::ROLE_USER, '/api/timesheets/11/stop', []);
|
||||
}
|
||||
|
||||
public function testStopNotAllowedForUser()
|
||||
public function testStopNotAllowedForUser(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -905,7 +976,7 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->assertApiResponseAccessDenied($client->getResponse(), 'Access denied.');
|
||||
}
|
||||
|
||||
public function testGetCollectionWithTags()
|
||||
public function testGetCollectionWithTags(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -924,33 +995,42 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
|
||||
$query = ['tags' => ['Test']];
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets', 'GET', $query);
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertEquals(10, \count($result));
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertNotEmpty($result);
|
||||
self::assertEquals(10, \count($result));
|
||||
self::assertApiResponseTypeStructure('TimesheetCollection', $result[0]);
|
||||
|
||||
$query = ['tags' => ['Test', 'Admin']];
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets', 'GET', $query);
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertEquals(10, \count($result));
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertNotEmpty($result);
|
||||
self::assertEquals(10, \count($result));
|
||||
self::assertApiResponseTypeStructure('TimesheetCollection', $result[0]);
|
||||
|
||||
$query = ['tags' => ['Nothing-2-see', 'here']];
|
||||
$this->assertAccessIsGranted($client, '/api/timesheets', 'GET', $query);
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertEquals(20, \count($result));
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertNotEmpty($result);
|
||||
self::assertEquals(20, \count($result));
|
||||
self::assertApiResponseTypeStructure('TimesheetCollection', $result[0]);
|
||||
}
|
||||
|
||||
public function testRestartAction()
|
||||
public function testRestartAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$timesheets = $this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -965,7 +1045,10 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->request($client, '/api/timesheets/' . $id . '/restart', 'PATCH');
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertApiResponseTypeStructure('TimesheetEntity', $result);
|
||||
$this->assertEmpty($result['description']);
|
||||
$this->assertEmpty($result['tags']);
|
||||
@@ -975,13 +1058,13 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$timesheet = $em->getRepository(Timesheet::class)->find($result['id']);
|
||||
$this->assertInstanceOf(\DateTime::class, $timesheet->getBegin());
|
||||
$this->assertNull($timesheet->getEnd());
|
||||
$this->assertEquals(1, $timesheet->getActivity()->getId());
|
||||
$this->assertEquals(1, $timesheet->getProject()->getId());
|
||||
self::assertEquals(1, $timesheet->getActivity()->getId());
|
||||
self::assertEquals(1, $timesheet->getProject()->getId());
|
||||
$this->assertEmpty($timesheet->getDescription());
|
||||
$this->assertEmpty($timesheet->getTags());
|
||||
}
|
||||
|
||||
public function testRestartActionWithBegin()
|
||||
public function testRestartActionWithBegin(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$timesheets = $this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -997,7 +1080,10 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->request($client, '/api/timesheets/' . $id . '/restart', 'PATCH', ['begin' => $begin->format(BaseApiController::DATE_FORMAT_PHP)]);
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertApiResponseTypeStructure('TimesheetEntity', $result);
|
||||
$this->assertEmpty($result['description']);
|
||||
$this->assertEmpty($result['tags']);
|
||||
@@ -1006,15 +1092,15 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
/** @var Timesheet $timesheet */
|
||||
$timesheet = $em->getRepository(Timesheet::class)->find($result['id']);
|
||||
$this->assertInstanceOf(\DateTime::class, $timesheet->getBegin());
|
||||
$this->assertEquals($begin->format(BaseApiController::DATE_FORMAT_PHP), $timesheet->getBegin()->format(BaseApiController::DATE_FORMAT_PHP));
|
||||
self::assertEquals($begin->format(BaseApiController::DATE_FORMAT_PHP), $timesheet->getBegin()->format(BaseApiController::DATE_FORMAT_PHP));
|
||||
$this->assertNull($timesheet->getEnd());
|
||||
$this->assertEquals(1, $timesheet->getActivity()->getId());
|
||||
$this->assertEquals(1, $timesheet->getProject()->getId());
|
||||
self::assertEquals(1, $timesheet->getActivity()->getId());
|
||||
self::assertEquals(1, $timesheet->getProject()->getId());
|
||||
$this->assertEmpty($timesheet->getDescription());
|
||||
$this->assertEmpty($timesheet->getTags());
|
||||
}
|
||||
|
||||
public function testRestartActionWithCopyData()
|
||||
public function testRestartActionWithCopyData(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$timesheets = $this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -1034,29 +1120,32 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$em->flush();
|
||||
|
||||
$timesheet = $em->getRepository(Timesheet::class)->find($id);
|
||||
$this->assertEquals('foo', $timesheet->getDescription());
|
||||
self::assertEquals('foo', $timesheet->getDescription());
|
||||
|
||||
$this->request($client, '/api/timesheets/' . $id . '/restart', 'PATCH', ['copy' => 'all']);
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertApiResponseTypeStructure('TimesheetEntity', $result);
|
||||
$this->assertEquals('foo', $result['description']);
|
||||
$this->assertEquals([['name' => 'sdfsdf', 'value' => 'nnnnn'], ['name' => '1234567890', 'value' => '1234567890']], $result['metaFields']);
|
||||
$this->assertEquals(['another', 'testing', 'bar'], $result['tags']);
|
||||
self::assertEquals('foo', $result['description']);
|
||||
self::assertEquals([['name' => 'sdfsdf', 'value' => 'nnnnn'], ['name' => '1234567890', 'value' => '1234567890']], $result['metaFields']);
|
||||
self::assertEquals(['another', 'testing', 'bar'], $result['tags']);
|
||||
|
||||
$em = $this->getEntityManager();
|
||||
/** @var Timesheet $timesheet */
|
||||
$timesheet = $em->getRepository(Timesheet::class)->find($result['id']);
|
||||
$this->assertInstanceOf(\DateTime::class, $timesheet->getBegin());
|
||||
$this->assertNull($timesheet->getEnd());
|
||||
$this->assertEquals(1, $timesheet->getActivity()->getId());
|
||||
$this->assertEquals(1, $timesheet->getProject()->getId());
|
||||
$this->assertEquals('foo', $timesheet->getDescription());
|
||||
$this->assertEquals(['another', 'testing', 'bar'], $timesheet->getTagsAsArray());
|
||||
self::assertEquals(1, $timesheet->getActivity()->getId());
|
||||
self::assertEquals(1, $timesheet->getProject()->getId());
|
||||
self::assertEquals('foo', $timesheet->getDescription());
|
||||
self::assertEquals(['another', 'testing', 'bar'], $timesheet->getTagsAsArray());
|
||||
}
|
||||
|
||||
public function testRestartNotAllowedForUser()
|
||||
public function testRestartNotAllowedForUser(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
|
||||
@@ -1078,12 +1167,12 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->assertApiResponseAccessDenied($client->getResponse(), 'Access denied.');
|
||||
}
|
||||
|
||||
public function testRestartThrowsNotFound()
|
||||
public function testRestartThrowsNotFound(): void
|
||||
{
|
||||
$this->assertEntityNotFoundForPatch(User::ROLE_USER, '/api/timesheets/42/restart', []);
|
||||
}
|
||||
|
||||
public function testDuplicateAction()
|
||||
public function testDuplicateAction(): void
|
||||
{
|
||||
$dateTime = new DateTimeFactory(new \DateTimeZone(self::TEST_TIMEZONE));
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
@@ -1099,30 +1188,36 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->request($client, '/api/timesheets', 'POST', [], json_encode($data));
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$this->assertIsArray($result);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertApiResponseTypeStructure('TimesheetEntity', $result);
|
||||
$this->assertNotEmpty($result['id']);
|
||||
self::assertNotEmpty($result['id']);
|
||||
$this->assertTrue($result['duration'] == 28800 || $result['duration'] == 28860); // 1 minute rounding might be applied
|
||||
$this->assertEquals(2016, $result['rate']);
|
||||
self::assertEquals(2016, $result['rate']);
|
||||
|
||||
$this->request($client, '/api/timesheets/' . $result['id'] . '/duplicate', 'PATCH');
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$this->assertIsArray($result);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertIsArray($result);
|
||||
self::assertApiResponseTypeStructure('TimesheetEntity', $result);
|
||||
$this->assertNotEmpty($result['id']);
|
||||
self::assertNotEmpty($result['id']);
|
||||
$this->assertTrue($result['duration'] == 28800 || $result['duration'] == 28860); // 1 minute rounding might be applied
|
||||
$this->assertEquals(2016, $result['rate']);
|
||||
self::assertEquals(2016, $result['rate']);
|
||||
}
|
||||
|
||||
public function testDuplicateThrowsNotFound()
|
||||
public function testDuplicateThrowsNotFound(): void
|
||||
{
|
||||
$this->assertEntityNotFoundForPatch(User::ROLE_ADMIN, '/api/timesheets/11/duplicate', []);
|
||||
}
|
||||
|
||||
public function testExportAction()
|
||||
public function testExportAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$timesheets = $this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -1135,7 +1230,11 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
|
||||
$this->request($client, '/api/timesheets/' . $id . '/export', 'PATCH');
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertApiResponseTypeStructure('TimesheetEntity', $result);
|
||||
|
||||
$em->clear();
|
||||
@@ -1151,7 +1250,7 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->assertFalse($timesheet->isExported());
|
||||
}
|
||||
|
||||
public function testExportNotAllowedForUser()
|
||||
public function testExportNotAllowedForUser(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$timesheets = $this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -1161,17 +1260,17 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
$this->assertApiResponseAccessDenied($client->getResponse(), 'Access denied.');
|
||||
}
|
||||
|
||||
public function testExportThrowsNotFound()
|
||||
public function testExportThrowsNotFound(): void
|
||||
{
|
||||
$this->assertEntityNotFoundForPatch(User::ROLE_ADMIN, '/api/timesheets/' . PHP_INT_MAX . '/export', []);
|
||||
}
|
||||
|
||||
public function testMetaActionThrowsNotFound()
|
||||
public function testMetaActionThrowsNotFound(): void
|
||||
{
|
||||
$this->assertEntityNotFoundForPatch(User::ROLE_ADMIN, '/api/timesheets/' . PHP_INT_MAX . '/meta', []);
|
||||
}
|
||||
|
||||
public function testMetaActionThrowsExceptionOnMissingName()
|
||||
public function testMetaActionThrowsExceptionOnMissingName(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$timesheets = $this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -1183,7 +1282,7 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
]);
|
||||
}
|
||||
|
||||
public function testMetaActionThrowsExceptionOnMissingValue()
|
||||
public function testMetaActionThrowsExceptionOnMissingValue(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$timesheets = $this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -1195,7 +1294,7 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
]);
|
||||
}
|
||||
|
||||
public function testMetaActionThrowsExceptionOnMissingMetafield()
|
||||
public function testMetaActionThrowsExceptionOnMissingMetafield(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$timesheets = $this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -1207,7 +1306,7 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
]);
|
||||
}
|
||||
|
||||
public function testMetaAction()
|
||||
public function testMetaAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$timesheets = $this->importFixtureForUser(User::ROLE_USER);
|
||||
@@ -1222,13 +1321,16 @@ class TimesheetControllerTest extends APIControllerBaseTest
|
||||
|
||||
$this->assertTrue($client->getResponse()->isSuccessful());
|
||||
|
||||
$result = json_decode($client->getResponse()->getContent(), true);
|
||||
$content = $client->getResponse()->getContent();
|
||||
self::assertIsString($content);
|
||||
$result = json_decode($content, true);
|
||||
|
||||
self::assertApiResponseTypeStructure('TimesheetEntity', $result);
|
||||
$this->assertEquals(['name' => 'metatestmock', 'value' => 'another,testing,bar'], $result['metaFields'][0]);
|
||||
self::assertEquals(['name' => 'metatestmock', 'value' => 'another,testing,bar'], $result['metaFields'][0]);
|
||||
|
||||
$em = $this->getEntityManager();
|
||||
/** @var Timesheet $timesheet */
|
||||
$timesheet = $em->getRepository(Timesheet::class)->find($id);
|
||||
$this->assertEquals('another,testing,bar', $timesheet->getMetaField('metatestmock')->getValue());
|
||||
self::assertEquals('another,testing,bar', $timesheet->getMetaField('metatestmock')->getValue());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,9 +179,20 @@ class TimesheetTest extends TestCase
|
||||
public function testClone(): void
|
||||
{
|
||||
$sut = new Timesheet();
|
||||
self::assertNull($sut->getModifiedAt());
|
||||
$sut->setExported(true);
|
||||
$sut->setDescription('Invalid timesheet category "foo" given, expected one of: work, holiday, sickness, parental, overtime');
|
||||
|
||||
$modifiedDate = new \DateTime();
|
||||
|
||||
$reflection = new \ReflectionClass($sut);
|
||||
$property = $reflection->getProperty('modifiedAt');
|
||||
$property->setAccessible(true);
|
||||
$property->setValue($sut, $modifiedDate);
|
||||
$property->setAccessible(false);
|
||||
|
||||
self::assertEquals($modifiedDate, $sut->getModifiedAt());
|
||||
|
||||
$meta = new TimesheetMeta();
|
||||
$meta->setName('blabla');
|
||||
$meta->setValue('1234567890');
|
||||
@@ -198,6 +209,9 @@ class TimesheetTest extends TestCase
|
||||
|
||||
$clone = clone $sut;
|
||||
|
||||
self::assertNotNull($sut->getModifiedAt());
|
||||
self::assertNull($clone->getModifiedAt());
|
||||
|
||||
foreach ($sut->getMetaFields() as $metaField) {
|
||||
$cloneMeta = $clone->getMetaField($metaField->getName());
|
||||
self::assertEquals($cloneMeta->getValue(), $metaField->getValue());
|
||||
|
||||
@@ -65,4 +65,9 @@ class DebugFormatter implements InvoiceFormatter
|
||||
{
|
||||
// does nothing
|
||||
}
|
||||
|
||||
public function getFormattedAmount(float $amount): string
|
||||
{
|
||||
return (string) $amount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ class InvoiceItemDefaultHydratorTest extends TestCase
|
||||
'entry.user_id',
|
||||
'entry.user_name',
|
||||
'entry.user_alias',
|
||||
'entry.user_display',
|
||||
'entry.user_title',
|
||||
'entry.activity',
|
||||
'entry.activity_id',
|
||||
|
||||
@@ -44,6 +44,7 @@ class InvoiceModelCustomerHydratorTest extends TestCase
|
||||
'customer.contact',
|
||||
'customer.company',
|
||||
'customer.vat',
|
||||
'customer.vat_id',
|
||||
'customer.country',
|
||||
'customer.number',
|
||||
'customer.homepage',
|
||||
|
||||
@@ -41,6 +41,7 @@ class InvoiceModelDefaultHydratorTest extends TestCase
|
||||
'invoice.vat',
|
||||
'invoice.language',
|
||||
'invoice.tax',
|
||||
'invoice.tax_hide',
|
||||
'invoice.tax_nc',
|
||||
'invoice.tax_plain',
|
||||
'invoice.total_time',
|
||||
@@ -76,6 +77,7 @@ class InvoiceModelDefaultHydratorTest extends TestCase
|
||||
'query.end_month',
|
||||
'query.end_month_number',
|
||||
'query.end_year',
|
||||
'user.see_others',
|
||||
];
|
||||
|
||||
$givenKeys = array_keys($model);
|
||||
|
||||
@@ -33,6 +33,7 @@ class InvoiceModelUserHydratorTest extends TestCase
|
||||
protected function assertModelStructure(array $model)
|
||||
{
|
||||
$keys = [
|
||||
'user.display',
|
||||
'user.alias',
|
||||
'user.email',
|
||||
'user.name',
|
||||
|
||||
@@ -84,6 +84,7 @@ class DebugRendererTest extends TestCase
|
||||
'invoice.currency',
|
||||
'invoice.currency_symbol',
|
||||
'invoice.vat',
|
||||
'invoice.tax_hide',
|
||||
'invoice.tax',
|
||||
'invoice.language',
|
||||
'invoice.tax_nc',
|
||||
@@ -127,6 +128,7 @@ class DebugRendererTest extends TestCase
|
||||
'customer.contact',
|
||||
'customer.company',
|
||||
'customer.vat',
|
||||
'customer.vat_id',
|
||||
'customer.country',
|
||||
'customer.number',
|
||||
'customer.homepage',
|
||||
@@ -150,14 +152,23 @@ class DebugRendererTest extends TestCase
|
||||
'activity.time_budget_open',
|
||||
'activity.time_budget_open_plain',
|
||||
'user.alias',
|
||||
'user.display',
|
||||
'user.email',
|
||||
'user.name',
|
||||
'user.title',
|
||||
'user.see_others',
|
||||
'user.meta.hello',
|
||||
'user.meta.kitty',
|
||||
'testFromModelHydrator',
|
||||
];
|
||||
|
||||
if ($activityCounter === 1) {
|
||||
$keys = array_merge($keys, [
|
||||
'query.activity.comment',
|
||||
'query.activity.name',
|
||||
]);
|
||||
}
|
||||
|
||||
if ($activityCounter > 1) {
|
||||
$keys = array_merge($keys, [
|
||||
'activity.1.budget_open',
|
||||
@@ -171,6 +182,14 @@ class DebugRendererTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
if ($projectCounter === 1) {
|
||||
$keys = array_merge($keys, [
|
||||
'query.project.name',
|
||||
'query.project.comment',
|
||||
'query.project.order_number',
|
||||
]);
|
||||
}
|
||||
|
||||
if ($projectCounter > 0) {
|
||||
$keys = array_merge($keys, [
|
||||
'project.id',
|
||||
@@ -254,6 +273,7 @@ class DebugRendererTest extends TestCase
|
||||
'entry.weekyear',
|
||||
'entry.user_id',
|
||||
'entry.user_name',
|
||||
'entry.user_display',
|
||||
'entry.user_alias',
|
||||
'entry.user_title',
|
||||
'entry.activity',
|
||||
|
||||
@@ -61,20 +61,27 @@ class TimesheetQueryTest extends BaseQueryTest
|
||||
protected function assertUser(TimesheetQuery $sut): void
|
||||
{
|
||||
self::assertNull($sut->getUser());
|
||||
self::assertFalse($sut->hasUsers());
|
||||
|
||||
$expected = new User();
|
||||
$expected->setUserIdentifier('foo-bar');
|
||||
$sut->setUser($expected);
|
||||
self::assertEquals($expected, $sut->getUser());
|
||||
self::assertTrue($sut->hasUsers());
|
||||
|
||||
$sut->setUser(null);
|
||||
self::assertFalse($sut->hasUsers());
|
||||
}
|
||||
|
||||
protected function assertUsers(TimesheetQuery $sut): void
|
||||
{
|
||||
self::assertEmpty($sut->getUsers());
|
||||
self::assertFalse($sut->hasUsers());
|
||||
|
||||
$user = $this->getMockBuilder(User::class)->disableOriginalConstructor()->getMock();
|
||||
$user->method('getId')->willReturn(1);
|
||||
$sut->addUser($user);
|
||||
self::assertTrue($sut->hasUsers());
|
||||
|
||||
$user = $this->getMockBuilder(User::class)->disableOriginalConstructor()->getMock();
|
||||
$user->method('getId')->willReturn(1);
|
||||
|
||||
@@ -28,30 +28,6 @@ class TagRepositoryTest extends AbstractRepositoryTest
|
||||
$this->importFixture($data);
|
||||
}
|
||||
|
||||
public function testFindIds()
|
||||
{
|
||||
$em = $this->getEntityManager();
|
||||
/** @var TagRepository $repository */
|
||||
$repository = $em->getRepository(Tag::class);
|
||||
|
||||
$result = $repository->findIdsByTagNameList('2018,Test');
|
||||
$this->assertIsArray($result);
|
||||
$this->assertNotEmpty($result);
|
||||
$this->assertEquals(7, \count($result));
|
||||
}
|
||||
|
||||
public function testFindNoIds()
|
||||
{
|
||||
$em = $this->getEntityManager();
|
||||
/** @var TagRepository $repository */
|
||||
$repository = $em->getRepository(Tag::class);
|
||||
|
||||
$result = $repository->findIdsByTagNameList('Simply');
|
||||
$this->assertIsArray($result);
|
||||
$this->assertEmpty($result);
|
||||
$this->assertEquals(0, \count($result));
|
||||
}
|
||||
|
||||
public function testFindAllTagNames()
|
||||
{
|
||||
$em = $this->getEntityManager();
|
||||
|
||||
@@ -1277,276 +1277,6 @@ parameters:
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testActiveAction\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testDeleteAction\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testDeleteActionForDifferentUser\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testDeleteActionForExportedRecordIsAllowedForAdmin\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testDeleteActionForExportedRecordIsNotAllowed\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testDeleteActionWithUnknownTimesheet\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testDeleteActionWithoutAuthorization\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testDuplicateAction\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testDuplicateThrowsNotFound\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testExportAction\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testExportNotAllowedForUser\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testExportThrowsNotFound\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testExportedFilter\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testGetCollection\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testGetCollectionForAllUser\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testGetCollectionForEmptyResult\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testGetCollectionForOtherUser\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testGetCollectionFull\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testGetCollectionWithQuery\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testGetCollectionWithQueryFailsWith404OnOutOfRangedPage\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testGetCollectionWithSingleParamsQuery\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testGetCollectionWithTags\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testGetEntity\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testGetEntityAccessAllowedForAdmin\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testGetEntityAccessDenied\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testGetEntityNotFound\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testGetRecentAction\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testInvalidPatchAction\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testIsSecure\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testMetaAction\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testMetaActionThrowsExceptionOnMissingMetafield\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testMetaActionThrowsExceptionOnMissingName\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testMetaActionThrowsExceptionOnMissingValue\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testMetaActionThrowsNotFound\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testPatchAction\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testPatchActionWithInvalidUser\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testPatchActionWithUnknownTimesheet\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testPostAction\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testPostActionForDifferentUser\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testPostActionWithFullExpandedResponse\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testPostActionWithInvisibleActivity\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testPostActionWithInvisibleProject\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testPostActionWithNonBillableCustomer\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testPostActionWithNonBillableCustomerExplicit\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testRestartAction\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testRestartActionWithBegin\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testRestartActionWithCopyData\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testRestartNotAllowedForUser\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testRestartThrowsNotFound\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testStopAction\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testStopActionTriggersValidationOnLongRunning\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testStopNotAllowedForUser\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\API\\\\TimesheetControllerTest\\:\\:testStopThrowsNotFound\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#"
|
||||
count: 32
|
||||
path: API/TimesheetControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#"
|
||||
count: 1
|
||||
@@ -8692,16 +8422,6 @@ parameters:
|
||||
count: 1
|
||||
path: Repository/TagRepositoryTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\Repository\\\\TagRepositoryTest\\:\\:testFindIds\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: Repository/TagRepositoryTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\Repository\\\\TagRepositoryTest\\:\\:testFindNoIds\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
path: Repository/TagRepositoryTest.php
|
||||
|
||||
-
|
||||
message: "#^Method App\\\\Tests\\\\Repository\\\\TagRepositoryTest\\:\\:testFindNoTagNames\\(\\) has no return type specified\\.$#"
|
||||
count: 1
|
||||
|
||||
Reference in New Issue
Block a user