/** * @dataProvider extractProvider * * @param string $rawDocument * @param mixed $expectedData * @param string $expectedContent */ public function testExtract($rawDocument, $expectedData, $expectedContent) { $fm = new Frontmatter(); $actualContent = $fm->extract($rawDocument); $this->assertSame($expectedContent, $actualContent); $this->assertSame($expectedData, $fm->getData()); }
/** * @param string $content * @param string|null $filepath */ public function __construct($content, $filepath = null) { $this->frontmatter = new Frontmatter(); $this->content = $this->frontmatter->extract($content); $this->filepath = $filepath; }