events: extend system configurations and set invoice formatter (#1995)
This commit is contained in:
@@ -86,14 +86,13 @@ class FormConfigurationTest extends TestCase
|
||||
$this->assertEquals('FR', $sut->find('defaults.customer.country'));
|
||||
}
|
||||
|
||||
public function testUnknownConfigAreNotImportedAndFindingThemThrowsException()
|
||||
public function testUnknownConfigAreImported()
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Unknown config: foobar');
|
||||
|
||||
$sut = $this->getSut($this->getDefaultSettings(), [
|
||||
(new Configuration())->setName('defaults.customer.foobar')->setValue('hello'),
|
||||
]);
|
||||
$this->assertTrue($sut->has('customer.foobar'));
|
||||
$this->assertFalse($sut->has('xxxx.foobar'));
|
||||
$this->assertEquals('hello', $sut->find('customer.foobar'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,15 +129,14 @@ class SystemConfigurationTest extends TestCase
|
||||
$this->assertEquals(false, $sut->find('timesheet.rules.allow_future_times'));
|
||||
}
|
||||
|
||||
public function testUnknownConfigAreNotImportedAndFindingThemThrowsException()
|
||||
public function testUnknownConfigs()
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Unknown config: foo');
|
||||
|
||||
$sut = $this->getSut($this->getDefaultSettings(), [
|
||||
(new Configuration())->setName('timesheet.foo')->setValue('hello'),
|
||||
]);
|
||||
$this->assertEquals('hello', $sut->find('foo'));
|
||||
$this->assertEquals('hello', $sut->find('timesheet.foo'));
|
||||
$this->assertFalse($sut->has('xxxxxxxx.yyyyyyyyy'));
|
||||
$this->assertNull($sut->find('xxxxxxxx.yyyyyyyyy'));
|
||||
}
|
||||
|
||||
public function testCalendarWithoutLoader()
|
||||
|
||||
@@ -116,14 +116,12 @@ class TimesheetConfigurationTest extends TestCase
|
||||
$this->assertEquals(false, $sut->find('timesheet.rules.allow_future_times'));
|
||||
}
|
||||
|
||||
public function testUnknownConfigAreNotImportedAndFindingThemThrowsException()
|
||||
public function testUnknownConfigAreImported()
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('Unknown config: foo');
|
||||
|
||||
$sut = $this->getSut($this->getDefaultSettings(), [
|
||||
(new Configuration())->setName('timesheet.foo')->setValue('hello'),
|
||||
]);
|
||||
$this->assertTrue($sut->has('foo'));
|
||||
$this->assertEquals('hello', $sut->find('foo'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user