Skip to content

Instantly share code, notes, and snippets.

@rachelbaker
Created May 2, 2014 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rachelbaker/840d9eb3876909391007 to your computer and use it in GitHub Desktop.
Save rachelbaker/840d9eb3876909391007 to your computer and use it in GitHub Desktop.
<?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