From 037669c63e20969d88a0c44f683cf9f443c9d9f6 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sat, 30 Jan 2010 10:55:39 -0500 Subject: [PATCH] and return the post --- classes/ComicPressTagBuilder.inc | 2 ++ test/ComicPressTagBuilderTest.php | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/classes/ComicPressTagBuilder.inc b/classes/ComicPressTagBuilder.inc index a9222cf..4f9328c 100644 --- a/classes/ComicPressTagBuilder.inc +++ b/classes/ComicPressTagBuilder.inc @@ -54,6 +54,8 @@ class ComicPressTagBuilder { return strtotime($this->post->post_date); case 'permalink': return get_permalink($this->post->ID); + case 'post': + return $this->post; default: $methods = $this->parse_method($method); if (!empty($methods)) { diff --git a/test/ComicPressTagBuilderTest.php b/test/ComicPressTagBuilderTest.php index f48c36b..57eb308 100644 --- a/test/ComicPressTagBuilderTest.php +++ b/test/ComicPressTagBuilderTest.php @@ -96,7 +96,13 @@ class ComicPressTagBuilderTest extends PHPUnit_Framework_TestCase { array('id', 1), array('title', 'Post title'), array('timestamp', strtotime('2010-01-01')), - array('permalink', 'the-slug') + array('permalink', 'the-slug'), + array('post', (object)array( + 'ID' => 1, + 'post_title' => 'Post title', + 'post_date' => '2010-01-01', + 'guid' => 'the-slug', + )) ); }