Test fixes

This commit is contained in:
Chris Kankiewicz
2025-03-16 21:50:53 -07:00
parent 112e629fad
commit db2b412f02
3 changed files with 18 additions and 4 deletions

View File

@@ -25,4 +25,8 @@
<listeners>
<listener class="JohnKary\PHPUnit\Listener\SpeedTrapListener" />
</listeners>
<php>
<server name="HTTP_HOST" value="localhost"/>
</php>
</phpunit>

View File

@@ -29,8 +29,8 @@ class TwigFactoryTest extends TestCase
$twig = (new TwigFactory($this->config, $callableResolver))();
$this->assertInstanceOf(
ViewFunctions\Asset::class,
$twig->getEnvironment()->getFunction('asset')->getCallable()
ViewFunctions\Analytics::class,
$twig->getEnvironment()->getFunction('analytics')->getCallable()
);
$this->assertInstanceOf(
@@ -58,6 +58,11 @@ class TwigFactoryTest extends TestCase
$twig->getEnvironment()->getFunction('markdown')->getCallable()
);
$this->assertInstanceOf(
ViewFunctions\ModifiedTime::class,
$twig->getEnvironment()->getFunction('modified_time')->getCallable()
);
$this->assertInstanceOf(
ViewFunctions\ParentUrl::class,
$twig->getEnvironment()->getFunction('parent_url')->getCallable()
@@ -78,6 +83,11 @@ class TwigFactoryTest extends TestCase
$twig->getEnvironment()->getFunction('url')->getCallable()
);
$this->assertInstanceOf(
ViewFunctions\Vite::class,
$twig->getEnvironment()->getFunction('vite')->getCallable()
);
$this->assertInstanceOf(
ViewFunctions\ZipUrl::class,
$twig->getEnvironment()->getFunction('zip_url')->getCallable()

View File

@@ -11,10 +11,10 @@ class MarkdownTest extends TestCase
{
public function test_it_can_parse_markdown_into_html(): void
{
$markdown = new Markdown(new ParsedownExtra, $this->cache);
$markdown = $this->container->get(Markdown::class);
$this->assertEquals(
'<p><strong>Test</strong> <code>markdown</code>, <del>please</del> <em>ignore</em></p>',
"<p><strong>Test</strong> <code>markdown</code>, <del>please</del> <em>ignore</em></p>\n",
$markdown('**Test** `markdown`, ~~please~~ _ignore_')
);
}