Files
kimai2/tests/Utils/ParsedownExtensionTest.php
Kevin Papst 4154de6bd1 Release 2.50 (#5835)
* replace p-0 class with fullsize embed option
* bump parsedown package
* remove support for file:// urls
* fix missing macro in export print template
* fix weekly hours with breaks
2026-02-25 21:07:40 +01:00

43 lines
1009 B
PHP

<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Tests\Utils;
use App\Utils\Parsedown;
use App\Utils\ParsedownExtension;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
#[CoversClass(Parsedown::class)]
#[CoversClass(ParsedownExtension::class)]
class ParsedownExtensionTest extends TestCase
{
public function testTableContainsCssClasses(): void
{
$sut = new ParsedownExtension();
$html = $sut->text('
| Item | Price |
|---|---|
| Something | $ 472,78 |
| Another entry | € 111 |
| | |
| Total | A lot |');
self::assertStringStartsWith('<table class="table">', $html);
}
public function testHeaderIsNotConverted(): void
{
$sut = new ParsedownExtension();
$html = $sut->text('
# Foo
');
self::assertEquals('<p># Foo</p>', $html);
}
}