예제 #1
0
 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);
 }
예제 #2
0
 /**
  * @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);
 }