release 0.8 (#567)

This commit is contained in:
Kevin Papst
2019-02-19 11:03:11 +01:00
committed by GitHub
parent b4f1cae323
commit 47b7046743
40 changed files with 446 additions and 341 deletions

View File

@@ -20,6 +20,8 @@ class DurationTest extends TestCase
public function testFormat()
{
$sut = new Duration();
$this->assertNull($sut->format(null));
$this->assertEquals('02:38', $sut->format(9494));
$this->assertEquals('02:38:14', $sut->format(9494, Duration::FORMAT_WITH_SECONDS));
}
@@ -73,7 +75,7 @@ class DurationTest extends TestCase
['13', Duration::FORMAT_COLON],
['13-13', Duration::FORMAT_COLON],
['13.13', Duration::FORMAT_COLON],
[1111, 1111, Duration::FORMAT_NATURAL],
[1111, Duration::FORMAT_NATURAL],
// invalid modes
[17, 'foo'],

View File

@@ -142,6 +142,7 @@ class LocaleSettingsTest extends TestCase
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Unknown locale given: xx
*/
public function testInvalidLocaleWithGivenLocale()
{
@@ -197,4 +198,16 @@ class LocaleSettingsTest extends TestCase
$this->assertEquals('YYYY-MM-DD HH:mm', $sut->getDateTimePickerFormat());
$this->assertEquals('DD.MM.YYYY HH:mm', $sut->getDateTimePickerFormat('de'));
}
/**
* @expectedException \InvalidArgumentException
* @expectedExceptionMessage Unknown setting for locale en: date_time_picker
*/
public function testUnknownSetting()
{
$sut = $this->getSut('en', ['en' => [
'xxx' => 'dd.MM.yyyy HH:mm',
]]);
$sut->getDateTimePickerFormat('en');
}
}

View File

@@ -14,6 +14,7 @@ use PHPUnit\Framework\TestCase;
/**
* @covers \App\Utils\Markdown
* @covers \App\Utils\ParsedownExtension
*/
class MarkdownTest extends TestCase
{
@@ -51,6 +52,26 @@ sdfsdf [asdfasdf](#test-1) asdfasdf
# test
aasdfasdf
EOT;
$this->assertEquals($html, $sut->toHtml($markdown));
}
public function testDuplicateIds()
{
$sut = new Markdown();
$html = <<<'EOT'
<h1 id="test">test</h1>
<h2 id="test-1">test</h2>
<h3 id="test-2">test</h3>
<h1 id="test-3">test</h1>
EOT;
$markdown = <<<EOT
# test
## test
### test
# test
EOT;
$this->assertEquals($html, $sut->toHtml($markdown));
}