protected function check($file) { $matter = new FrontMatter(new Resource($file)); $m = $matter->getMatter(); $c = $matter->getContents(); $this->assertTrue(!empty($c)); $this->assertTrue(!empty($m)); $this->assertTrue(is_array($m)); $this->assertTrue(isset($m['excerpt'])); $this->assertTrue(isset($m['summary'])); $this->assertTrue(is_array($m['category'])); }
/** * Returns the contents of a file, strips front-matter when needed * * @param object $resource * @return string */ public function getContents(Resource $resource) { $frontMatter = new FrontMatter($resource); return $frontMatter->getContents(); }