Created
May 2, 2014 14:36
-
-
Save rachelbaker/840d9eb3876909391007 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Unit tests covering WP_JSON_Posts functionality. | |
* | |
* @package WordPress | |
* @subpackage JSON API | |
*/ | |
class WP_Test_JSON_Post extends WP_UnitTestCase { | |
public function setUp() { | |
parent::setUp(); | |
$this->post = $this->factory->post->create(); | |
$this->post_obj = get_post( $this->post ); | |
$this->fake_server = $this->getMock('WP_JSON_Server'); | |
$this->endpoint = new WP_JSON_Posts( $this->fake_server ); | |
} | |
public function test_get_post() { | |
$this->assertTrue( is_object( $this->post_obj ) ); | |
} | |
public function test_post_id() { | |
$this->assertEquals( $this->post, $this->post_obj->ID ); | |
} | |
public function tearDown() { | |
parent::tearDown(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment