public function testOnMeta() { $this->markTestSkipped(); $page = new Page('test'); $page->setMetas(['title' => 'Hello World!']); $event = new GenericEvent($page); $redirect = new Redirect(new PathResolver(new RequestContext('/foo.php'))); // no redirect $redirect->onMeta(new GenericEvent($page)); // set meta redirect $page->setMetas(['redirect' => 'foobar']); $this->setExpectedException('Gitiki\\Exception\\PageRedirectedException'); $redirect->onMeta($event); }
/** * @dataProvider provideMetas */ public function testOnMetaParse($metas, $comment) { $page = new Page('test'); $page->setMetas($metas); (new Metadata())->onMetaParse(new GenericEvent($page)); $this->assertInternalType('array', $page->getMetas(), $comment); $this->assertEquals(['foo' => 'bar'], $page->getMetas(), $comment); }