Skip to content

Commit

Permalink
Add some dummy tests to figure out where travis expects the wp-api pl…
Browse files Browse the repository at this point in the history
…ugin
  • Loading branch information
jtsternberg committed Sep 9, 2016
1 parent 30aa4fc commit c73fcb9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
10 changes: 0 additions & 10 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ function _tests_cmb2_manually_load_plugin() {
$wp_content = dirname( dirname( $plugin ) );

if (
( $rest_api = $wp_content . '/plugins/WP-API/plugin.php' )
&& file_exists( $rest_api )
) {
require_once $rest_api;
} elseif (
( $rest_api = $wp_content . '/plugins/rest-api/plugin.php' )
&& file_exists( $rest_api )
) {
require_once $rest_api;
} elseif (
( $rest_api = dirname( $test_root ) . '/wp-content/plugins/rest-api/plugin.php' )
&& file_exists( $rest_api )
) {
Expand Down
9 changes: 9 additions & 0 deletions tests/test-cmb-rest-registered-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ public function tearDown() {
parent::tearDown();
}

public function test_wp_api_installed() {
global $test_root;

$this->assertEquals( '/tmp/wordpress/tests', $test_root );
$rest_api = dirname( $test_root ) . '/wp-content/plugins/rest-api/plugin.php';
$this->assertEquals( '/tmp/wordpress/wp-content/plugins/rest-api/plugin.php', $rest_api );
$this->assertTrue( file_exists( $rest_api ) );
}

public function test_rest_posts_controller_exists() {
$this->assertTrue( class_exists( 'WP_REST_Posts_Controller' ) );
}
Expand Down

0 comments on commit c73fcb9

Please sign in to comment.