added json, xml and txt invoice renderer (#1576)
This commit is contained in:
@@ -50,7 +50,7 @@ class ExtensionsTest extends TestCase
|
||||
|
||||
public function testGetFilters()
|
||||
{
|
||||
$filters = ['duration', 'duration_decimal', 'money', 'currency', 'country', 'language', 'amount', 'docu_link'];
|
||||
$filters = ['duration', 'duration_decimal', 'money', 'currency', 'country', 'language', 'amount', 'docu_link', 'multiline_indent'];
|
||||
$sut = $this->getSut($this->localeDe);
|
||||
$twigFilters = $sut->getFilters();
|
||||
$this->assertCount(count($filters), $twigFilters);
|
||||
@@ -305,4 +305,43 @@ class ExtensionsTest extends TestCase
|
||||
$this->assertNull($sut->getClassName(null));
|
||||
$this->assertEquals('App\Entity\User', $sut->getClassName(new User()));
|
||||
}
|
||||
|
||||
public function getMultilineTestData()
|
||||
{
|
||||
return [
|
||||
[' ', null, ['']],
|
||||
[' ', '', ['']],
|
||||
[' ', 0, [' 0']],
|
||||
[' ', 'sdfsdf
|
||||
sdfsdf
|
||||
|
||||
aksljdfh laksjd hflka sjhdf lakjhsdflak jsdfh
|
||||
dfsdfsdfsdfsdf',
|
||||
[' sdfsdf', ' sdfsdf', ' ', ' aksljdfh laksjd hflka sjhdf lakjhsdflak jsdfh', ' dfsdfsdfsdfsdf']
|
||||
],
|
||||
['###', 'sdfsdf' . PHP_EOL .
|
||||
'sdfsdf' . PHP_EOL .
|
||||
'' . PHP_EOL .
|
||||
' aksljdfh laksjd hflka sjhdf lakjhsdflak jsdfh' . PHP_EOL .
|
||||
'dfsdfsdfsdfsdf',
|
||||
['###sdfsdf', '###sdfsdf', '###', '### aksljdfh laksjd hflka sjhdf lakjhsdflak jsdfh', '###dfsdfsdfsdfsdf']
|
||||
],
|
||||
[' ', 'sdfsdf' . "\r\n" .
|
||||
'sdfsdf' . "\r\n" .
|
||||
'' . "\r\n" .
|
||||
' aksljdfh laksjd hflka sjhdf lakjhsdflak jsdfh' . "\r\n" .
|
||||
'dfsdfsdfsdfsdf',
|
||||
[' sdfsdf', ' sdfsdf', ' ', ' aksljdfh laksjd hflka sjhdf lakjhsdflak jsdfh', ' dfsdfsdfsdfsdf']
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider getMultilineTestData
|
||||
*/
|
||||
public function testMultilineIndent($indent, $string, $expected)
|
||||
{
|
||||
$sut = $this->getSut($this->localeEn);
|
||||
self::assertEquals(implode("\n", $expected), $sut->multilineIndent($string, $indent));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user