public function permalink() { if (!$this->permalink) { $this->permalink = $this->post->permalink(); } return $this->permalink; }
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()); }