for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Lichtenwallner (https://lichtenwallner.at)
*
* @see https://github.com/jolicht/markdown-cms for the canonical source repository
* @license https://github.com/jolicht/markdown-cms/blob/master/LICENSE MIT
* @copyright Copyright (c) Johannes Lichtenwallner
*/
declare(strict_types = 1);
namespace JolichtTest\MarkdownCms\Markdown;
use Reddogs\Test\ServiceManagerAwareTestCase;
use Jolicht\MarkdownCms\ModuleConfig;
use Jolicht\MarkdownCms\Markdown\FrontYamlParserFactory;
use Mni\FrontYAML\Parser;
use Mni\FrontYAML\Bridge\CommonMark\CommonMarkParser;
class FrontYamlParserFactoryTest extends ServiceManagerAwareTestCase
{
private $factory;
protected function setUp()
$this->setConfigProviders([
ModuleConfig::class
]);
parent::setUp();
$this->factory = new FrontYamlParserFactory();
}
public function testContainerHasService()
$this->assertTrue($this->getContainer()->has(Parser::class));
public function testInvoke()
$frontYaml = $this->factory->__invoke($this->getContainer(), Parser::class);
$this->assertInstanceOf(Parser::class, $frontYaml);
$reflectionObject = new \ReflectionObject($frontYaml);
$reflectionProperty = $reflectionObject->getProperty('markdownParser');
$reflectionProperty->setAccessible(true);
$this->assertInstanceOf(CommonMarkParser::class, $reflectionProperty->getValue($frontYaml));