update to Symfony 4.4 (#1275)

This commit is contained in:
Kevin Papst
2020-02-04 15:29:26 +01:00
committed by GitHub
parent 375691365e
commit 75dcae6fbe
53 changed files with 1046 additions and 1019 deletions

View File

@@ -42,7 +42,7 @@ class CustomerControllerTest extends ControllerBaseTest
public function testIndexActionWithSearchTermQuery()
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$fixture = new CustomerFixtures();
$fixture->setAmount(5);
$fixture->setCallback(function (Customer $customer) {
@@ -51,7 +51,7 @@ class CustomerControllerTest extends ControllerBaseTest
$customer->setMetaField((new CustomerMeta())->setName('location')->setValue('homeoffice'));
$customer->setMetaField((new CustomerMeta())->setName('feature')->setValue('timetracking'));
});
$this->importFixture($em, $fixture);
$this->importFixture($client, $fixture);
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$this->assertAccessIsGranted($client, '/admin/customer/');
@@ -161,14 +161,14 @@ class CustomerControllerTest extends ControllerBaseTest
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$this->assertAccessIsGranted($client, '/admin/customer/1/details');
$node = $client->getCrawler()->filter('div.box#team_listing_box .box-body');
self::assertStringContainsString('Visible to everyone, as no team was assigned yet.', $node->text());
self::assertStringContainsString('Visible to everyone, as no team was assigned yet.', $node->text(null, true));
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$this->request($client, '/admin/customer/1/create_team');
$this->assertIsRedirect($client, $this->createUrl('/admin/customer/1/details'));
$client->followRedirect();
$node = $client->getCrawler()->filter('div.box#team_listing_box .box-body');
self::assertStringContainsString('Only visible to the following teams and all admins.', $node->text());
self::assertStringContainsString('Only visible to the following teams and all admins.', $node->text(null, true));
$node = $client->getCrawler()->filter('div.box#team_listing_box .box-body table tbody tr');
self::assertEquals(1, $node->count());
}
@@ -183,10 +183,11 @@ class CustomerControllerTest extends ControllerBaseTest
/** @var EntityManager $em */
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$customer = $em->getRepository(Customer::class)->find(1);
$fixture = new ProjectFixtures();
$fixture->setAmount(9); // to trigger a second page (every third activity is hidden)
$fixture->setCustomers([$customer]);
$this->importFixture($em, $fixture);
$this->importFixture($client, $fixture);
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$this->assertAccessIsGranted($client, '/admin/customer/1/projects/1');
@@ -267,7 +268,7 @@ class CustomerControllerTest extends ControllerBaseTest
$fixture = new TeamFixtures();
$fixture->setAmount(2);
$fixture->setAddCustomer(false);
$this->importFixture($em, $fixture);
$this->importFixture($client, $fixture);
$this->assertAccessIsGranted($client, '/admin/customer/1/permissions');
$form = $client->getCrawler()->filter('form[name=customer_team_permission_form]')->form();
@@ -292,10 +293,9 @@ class CustomerControllerTest extends ControllerBaseTest
{
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$fixture = new CustomerFixtures();
$fixture->setAmount(1);
$this->importFixture($em, $fixture);
$this->importFixture($client, $fixture);
$this->request($client, '/admin/customer/2/edit');
$this->assertTrue($client->getResponse()->isSuccessful());
@@ -322,7 +322,7 @@ class CustomerControllerTest extends ControllerBaseTest
$fixture = new TimesheetFixtures();
$fixture->setUser($this->getUserByRole($em, User::ROLE_USER));
$fixture->setAmount(10);
$this->importFixture($em, $fixture);
$this->importFixture($client, $fixture);
$timesheets = $em->getRepository(Timesheet::class)->findAll();
$this->assertEquals(10, count($timesheets));
@@ -361,10 +361,10 @@ class CustomerControllerTest extends ControllerBaseTest
$fixture = new TimesheetFixtures();
$fixture->setUser($this->getUserByRole($em, User::ROLE_USER));
$fixture->setAmount(10);
$this->importFixture($em, $fixture);
$this->importFixture($client, $fixture);
$fixture = new CustomerFixtures();
$fixture->setAmount(1)->setIsVisible(true);
$this->importFixture($em, $fixture);
$this->importFixture($client, $fixture);
$timesheets = $em->getRepository(Timesheet::class)->findAll();
$this->assertEquals(10, count($timesheets));