Skip to content

Commit

Permalink
Merge pull request WP-API#215 from WP-API/fix-plugin-tests
Browse files Browse the repository at this point in the history
Fix plugin tests
  • Loading branch information
rmccue committed May 24, 2014
2 parents 7845664 + 67a1b87 commit 57f75e2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions plugin.php
Expand Up @@ -23,6 +23,7 @@
include_once( dirname( __FILE__ ) . '/lib/class-wp-json-datetime.php' );

include_once( dirname( __FILE__ ) . '/lib/class-wp-json-responsehandler.php' );
include_once( dirname( __FILE__ ) . '/lib/class-wp-json-server.php' );
include_once( dirname( __FILE__ ) . '/lib/class-wp-json-responseinterface.php' );
include_once( dirname( __FILE__ ) . '/lib/class-wp-json-response.php' );

Expand Down Expand Up @@ -113,8 +114,6 @@ function json_api_loaded() {
if ( empty( $GLOBALS['wp']->query_vars['json_route'] ) )
return;

include_once( dirname( __FILE__ ) . '/lib/class-wp-json-server.php' );

/**
* Whether this is a XMLRPC Request
*
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Expand Up @@ -8,7 +8,7 @@

// Activates this plugin in WordPress so it can be tested.
$GLOBALS['wp_tests_options'] = array(
'active_plugins' => array( 'WP-API/plugin.php' ),
'active_plugins' => array( basename( dirname( dirname( __FILE__ ) ) ) . '/plugin.php' ),
);

// If the develop repo location is defined (as WP_DEVELOP_DIR), use that
Expand Down
3 changes: 2 additions & 1 deletion tests/test_json_plugin.php
Expand Up @@ -15,7 +15,8 @@ class WP_Test_JSON_Plugin extends WP_UnitTestCase {
* The plugin should be installed and activated.
*/
function test_plugin_activated() {
$this->assertTrue( is_plugin_active( 'WP-API/plugin.php' ) );
$directory = basename( dirname( dirname( __FILE__ ) ) );
$this->assertTrue( is_plugin_active( $directory . '/plugin.php' ) );
}

/**
Expand Down
2 changes: 0 additions & 2 deletions tests/test_json_server.php
Expand Up @@ -24,8 +24,6 @@ function setUp() {

parent::setUp();

include_once( plugin_dir_path( dirname( __FILE__ ) ) . 'lib/class-wp-json-server.php' );

// Allow for a plugin to insert a different class to handle requests.
$wp_json_server_class = apply_filters('wp_json_server_class', 'WP_JSON_Server');
$wp_json_server = new $wp_json_server_class;
Expand Down

0 comments on commit 57f75e2

Please sign in to comment.