added internal rates (#1591)

This commit is contained in:
Kevin Papst
2020-04-08 14:50:15 +02:00
committed by GitHub
parent 82c713031e
commit 68d703d1e3
128 changed files with 4044 additions and 1571 deletions

View File

@@ -31,8 +31,22 @@ class TeamControllerTest extends APIControllerBaseTest
public function testIsSecure()
{
$this->assertUrlIsSecured('/api/teams');
$this->assertUrlIsSecuredForRole(User::ROLE_USER, '/api/teams');
$this->assertUrlIsSecuredForRole(User::ROLE_TEAMLEAD, '/api/teams');
}
public function getRoleTestData()
{
return [
[User::ROLE_USER],
[User::ROLE_TEAMLEAD],
];
}
/**
* @dataProvider getRoleTestData
*/
public function testIsSecureForRole(string $role)
{
$this->assertUrlIsSecuredForRole($role, '/api/teams');
}
public function testGetCollection()
@@ -66,7 +80,7 @@ class TeamControllerTest extends APIControllerBaseTest
public function testDeleteActionWithUnknownTeam()
{
$this->assertEntityNotFoundForDelete(User::ROLE_ADMIN, '/api/teams/255', []);
$this->assertEntityNotFoundForDelete(User::ROLE_ADMIN, '/api/teams/255');
}
public function testPostAction()
@@ -142,8 +156,6 @@ class TeamControllerTest extends APIControllerBaseTest
$this->assertTrue($client->getResponse()->isSuccessful());
self::assertEquals(Response::HTTP_NO_CONTENT, $client->getResponse()->getStatusCode());
$this->assertEmpty($client->getResponse()->getContent());
$this->assertEntityNotFound(User::ROLE_ADMIN, '/api/teams/' . $id);
}
public function testPostMemberAction()
@@ -334,7 +346,7 @@ class TeamControllerTest extends APIControllerBaseTest
$customer->setVisible(false);
$customer->setCountry('DE');
$customer->setTimezone('Europe/Berlin');
$em = static::$kernel->getContainer()->get('doctrine.orm.entity_manager');
$em = $this->getEntityManager();
$em->persist($customer);
$em->flush();
@@ -472,7 +484,7 @@ class TeamControllerTest extends APIControllerBaseTest
$project->setName('foooo');
$project->setVisible(false);
$project->setCustomer($customer);
$em = static::$kernel->getContainer()->get('doctrine.orm.entity_manager');
$em = $this->getEntityManager();
$em->persist($customer);
$em->persist($project);
$em->flush();