Release 2.12 (#4609)
This commit is contained in:
@@ -88,12 +88,12 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
return [$rate1, $rate2];
|
||||
}
|
||||
|
||||
public function testIsSecure()
|
||||
public function testIsSecure(): void
|
||||
{
|
||||
$this->assertUrlIsSecured('/api/projects');
|
||||
}
|
||||
|
||||
public function testGetCollection()
|
||||
public function testGetCollection(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$this->assertAccessIsGranted($client, '/api/projects');
|
||||
@@ -242,7 +242,7 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
yield ['/api/projects', 1, ['customers' => ['2', '2'], 'visible' => VisibilityInterface::SHOW_HIDDEN, 'start' => '2010-12-11', 'end' => '2030-12-11'], []];
|
||||
}
|
||||
|
||||
public function testGetEntity()
|
||||
public function testGetEntity(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$em = $this->getEntityManager();
|
||||
@@ -297,12 +297,12 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
}
|
||||
}
|
||||
|
||||
public function testNotFound()
|
||||
public function testNotFound(): void
|
||||
{
|
||||
$this->assertEntityNotFound(User::ROLE_USER, '/api/projects/' . PHP_INT_MAX, 'GET', 'App\\Entity\\Project object not found by the @ParamConverter annotation.');
|
||||
}
|
||||
|
||||
public function testPostAction()
|
||||
public function testPostAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$data = [
|
||||
@@ -331,7 +331,7 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
self::assertFalse($result['visible']);
|
||||
}
|
||||
|
||||
public function testPostActionWithOtherFields()
|
||||
public function testPostActionWithOtherFields(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$data = [
|
||||
@@ -354,7 +354,7 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
self::assertTrue($result['visible']);
|
||||
}
|
||||
|
||||
public function testPostActionWithOtherFieldsAndFalse()
|
||||
public function testPostActionWithOtherFieldsAndFalse(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$data = [
|
||||
@@ -377,7 +377,7 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
self::assertFalse($result['visible']);
|
||||
}
|
||||
|
||||
public function testPostActionWithOtherFields3()
|
||||
public function testPostActionWithOtherFields3(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$data = [
|
||||
@@ -400,7 +400,7 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
self::assertTrue($result['visible']);
|
||||
}
|
||||
|
||||
public function testPostActionWithLeastFields()
|
||||
public function testPostActionWithLeastFields(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$data = [
|
||||
@@ -420,7 +420,7 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
self::assertFalse($result['visible']);
|
||||
}
|
||||
|
||||
public function testPostActionWithInvalidUser()
|
||||
public function testPostActionWithInvalidUser(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
$data = [
|
||||
@@ -433,7 +433,7 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
$this->assertApiResponseAccessDenied($response, 'User cannot create projects');
|
||||
}
|
||||
|
||||
public function testPostActionWithInvalidData()
|
||||
public function testPostActionWithInvalidData(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$data = [
|
||||
@@ -447,7 +447,7 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
$this->assertApiCallValidationError($response, ['customer'], true);
|
||||
}
|
||||
|
||||
public function testPatchAction()
|
||||
public function testPatchAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$data = [
|
||||
@@ -467,7 +467,7 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
$this->assertNotEmpty($result['id']);
|
||||
}
|
||||
|
||||
public function testPatchActionWithInvalidUser()
|
||||
public function testPatchActionWithInvalidUser(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_USER);
|
||||
|
||||
@@ -482,12 +482,12 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
$this->assertApiResponseAccessDenied($response, 'User cannot update project');
|
||||
}
|
||||
|
||||
public function testPatchActionWithUnknownActivity()
|
||||
public function testPatchActionWithUnknownActivity(): void
|
||||
{
|
||||
$this->assertEntityNotFoundForPatch(User::ROLE_USER, '/api/projects/255', []);
|
||||
}
|
||||
|
||||
public function testInvalidPatchAction()
|
||||
public function testInvalidPatchAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
$data = [
|
||||
@@ -502,12 +502,12 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
$this->assertApiCallValidationError($response, ['customer']);
|
||||
}
|
||||
|
||||
public function testMetaActionThrowsNotFound()
|
||||
public function testMetaActionThrowsNotFound(): void
|
||||
{
|
||||
$this->assertEntityNotFoundForPatch(User::ROLE_ADMIN, '/api/projects/42/meta', []);
|
||||
}
|
||||
|
||||
public function testMetaActionThrowsExceptionOnMissingName()
|
||||
public function testMetaActionThrowsExceptionOnMissingName(): void
|
||||
{
|
||||
$this->assertExceptionForPatchAction(User::ROLE_ADMIN, '/api/projects/1/meta', ['value' => 'X'], [
|
||||
'code' => 400,
|
||||
@@ -515,7 +515,7 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
]);
|
||||
}
|
||||
|
||||
public function testMetaActionThrowsExceptionOnMissingValue()
|
||||
public function testMetaActionThrowsExceptionOnMissingValue(): void
|
||||
{
|
||||
$this->assertExceptionForPatchAction(User::ROLE_ADMIN, '/api/projects/1/meta', ['name' => 'X'], [
|
||||
'code' => 400,
|
||||
@@ -523,7 +523,7 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
]);
|
||||
}
|
||||
|
||||
public function testMetaActionThrowsExceptionOnMissingMetafield()
|
||||
public function testMetaActionThrowsExceptionOnMissingMetafield(): void
|
||||
{
|
||||
$this->assertExceptionForPatchAction(User::ROLE_ADMIN, '/api/projects/1/meta', ['name' => 'X', 'value' => 'Y'], [
|
||||
'code' => 404,
|
||||
@@ -531,7 +531,7 @@ class ProjectControllerTest extends APIControllerBaseTest
|
||||
]);
|
||||
}
|
||||
|
||||
public function testMetaAction()
|
||||
public function testMetaAction(): void
|
||||
{
|
||||
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
|
||||
self::getContainer()->get('event_dispatcher')->addSubscriber(new ProjectTestMetaFieldSubscriberMock());
|
||||
|
||||
Reference in New Issue
Block a user