added default settings for new customer form (#358)

This commit is contained in:
Toby Batch
2018-10-21 14:27:43 +01:00
committed by Kevin Papst
parent b46e752d0a
commit 3075276a52
7 changed files with 80 additions and 1 deletions

View File

@@ -38,6 +38,16 @@ class CustomerControllerTest extends ControllerBaseTest
$client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN);
$this->assertAccessIsGranted($client, '/admin/customer/create');
$form = $client->getCrawler()->filter('form[name=customer_edit_form]')->form();
$kernel = self::bootKernel();
$container = $kernel->getContainer();
$defaults = $container->getParameter('kimai.defaults')['customer'];
$editForm = $client->getCrawler()->filter('form[name=customer_edit_form]')->form();
$this->assertEquals($defaults['country'], $editForm->get('customer_edit_form[country]')->getValue());
$this->assertEquals($defaults['currency'], $editForm->get('customer_edit_form[currency]')->getValue());
$this->assertEquals($defaults['timezone'], $editForm->get('customer_edit_form[timezone]')->getValue());
$client->submit($form, [
'customer_edit_form' => [
'name' => 'Test Customer',