Ejemplo n.º 1
0
 public function path()
 {
     if (!$this->path) {
         $this->path = $this->post->path();
     }
     return $this->path;
 }
Ejemplo n.º 2
0
 function testPostPathPrettyPermalinks()
 {
     $struc = '/blog/%year%/%monthnum%/%postname%/';
     update_option('permalink_structure', $struc);
     $pid = $this->factory->post->create(array('post_date' => '2014-05-28'));
     $post = new TimberPost($pid);
     $this->assertStringStartsWith('http://example.org/blog/2014/05/post-title', $post->permalink());
     $this->assertStringStartsWith('/blog/2014/05/post-title', $post->path());
 }