added project importer and grandtotal converter (#1468)
This commit is contained in:
@@ -16,6 +16,7 @@ use PHPUnit\Framework\TestCase;
|
||||
/**
|
||||
* @covers \App\Configuration\FormConfiguration
|
||||
* @covers \App\Configuration\StringAccessibleConfigTrait
|
||||
* @group legacy
|
||||
*/
|
||||
class FormConfigurationTest extends TestCase
|
||||
{
|
||||
@@ -34,6 +35,13 @@ class FormConfigurationTest extends TestCase
|
||||
'currency' => 'GBP',
|
||||
'country' => 'FR',
|
||||
],
|
||||
'user' => [
|
||||
'timezone' => 'Europe/London',
|
||||
'currency' => 'GBP',
|
||||
'country' => 'FR',
|
||||
'language' => 'it',
|
||||
'theme' => 'blue',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -43,6 +51,11 @@ class FormConfigurationTest extends TestCase
|
||||
(new Configuration())->setName('defaults.customer.timezone')->setValue('Russia/Moscov'),
|
||||
(new Configuration())->setName('defaults.customer.currency')->setValue('USD'),
|
||||
(new Configuration())->setName('defaults.customer.country')->setValue('RU'),
|
||||
(new Configuration())->setName('defaults.user.timezone')->setValue('Russia/Moscov'),
|
||||
(new Configuration())->setName('defaults.user.currency')->setValue('USD'),
|
||||
(new Configuration())->setName('defaults.user.language')->setValue('RU'),
|
||||
(new Configuration())->setName('defaults.user.country')->setValue('RU'),
|
||||
(new Configuration())->setName('defaults.user.theme')->setValue('black'),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -66,6 +79,11 @@ class FormConfigurationTest extends TestCase
|
||||
$this->assertEquals('Russia/Moscov', $sut->getCustomerDefaultTimezone());
|
||||
$this->assertEquals('USD', $sut->getCustomerDefaultCurrency());
|
||||
$this->assertEquals('RU', $sut->getCustomerDefaultCountry());
|
||||
$this->assertEquals('USD', $sut->getUserDefaultCurrency());
|
||||
$this->assertEquals('RU', $sut->getUserDefaultLanguage());
|
||||
$this->assertEquals('black', $sut->getUserDefaultTheme());
|
||||
$this->assertEquals('Russia/Moscov', $sut->getUserDefaultTimezone());
|
||||
$this->assertEquals('Russia/Moscov', $sut->offsetGet('defaults.user.timezone'));
|
||||
}
|
||||
|
||||
public function testDefaultWithMixedConfigs()
|
||||
|
||||
@@ -51,6 +51,12 @@ class SystemConfigurationTest extends TestCase
|
||||
'currency' => 'GBP',
|
||||
'country' => 'FR',
|
||||
],
|
||||
'user' => [
|
||||
'timezone' => 'foo/bar',
|
||||
'theme' => 'blue',
|
||||
'language' => 'IT',
|
||||
'currency' => 'USD',
|
||||
],
|
||||
],
|
||||
'calendar' => [
|
||||
'businessHours' => [
|
||||
@@ -164,4 +170,28 @@ class SystemConfigurationTest extends TestCase
|
||||
$sources = $sut->getCalendarGoogleSources();
|
||||
$this->assertEquals(2, \count($sources));
|
||||
}
|
||||
|
||||
public function testFormDefaultWithoutLoader()
|
||||
{
|
||||
$sut = $this->getSut($this->getDefaultSettings(), []);
|
||||
$this->assertEquals('Europe/London', $sut->getCustomerDefaultTimezone());
|
||||
$this->assertEquals('GBP', $sut->getCustomerDefaultCurrency());
|
||||
$this->assertEquals('FR', $sut->getCustomerDefaultCountry());
|
||||
$this->assertEquals('foo/bar', $sut->getUserDefaultTimezone());
|
||||
$this->assertEquals('blue', $sut->getUserDefaultTheme());
|
||||
$this->assertEquals('IT', $sut->getUserDefaultLanguage());
|
||||
$this->assertEquals('USD', $sut->getUserDefaultCurrency());
|
||||
}
|
||||
|
||||
public function testFormDefaultWithLoader()
|
||||
{
|
||||
$sut = $this->getSut($this->getDefaultSettings(), $this->getDefaultLoaderSettings());
|
||||
$this->assertEquals('Russia/Moscov', $sut->getCustomerDefaultTimezone());
|
||||
$this->assertEquals('RUB', $sut->getCustomerDefaultCurrency());
|
||||
$this->assertEquals('FR', $sut->getCustomerDefaultCountry());
|
||||
$this->assertEquals('foo/bar', $sut->getUserDefaultTimezone());
|
||||
$this->assertEquals('blue', $sut->getUserDefaultTheme());
|
||||
$this->assertEquals('IT', $sut->getUserDefaultLanguage());
|
||||
$this->assertEquals('USD', $sut->getUserDefaultCurrency());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ use App\Configuration\ConfigLoaderInterface;
|
||||
use App\Entity\Configuration;
|
||||
|
||||
/**
|
||||
* @covers \App\Configuration\FormConfiguration
|
||||
* @covers \App\Configuration\SystemConfiguration
|
||||
*/
|
||||
class TestConfigLoader implements ConfigLoaderInterface
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user