diff --git a/tests/bootstrap.php b/tests/bootstrap.php index ea7dd4c59..12d467ecc 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -32,4 +32,5 @@ require_once(__DIR__ . '/factories/class-tainacan-entity-factory.php'); require_once(__DIR__ . '/factories/class-tainacan-field-factory.php'); require_once(__DIR__ . '/factories/class-tainacan-filter-factory.php'); require_once(__DIR__ . '/tainacan-unit-test-case.php'); +require_once(__DIR__ . '/tainacan-unit-api-test-case.php'); diff --git a/tests/tainacan-unit-api-test-case.php b/tests/tainacan-unit-api-test-case.php new file mode 100644 index 000000000..977619ac4 --- /dev/null +++ b/tests/tainacan-unit-api-test-case.php @@ -0,0 +1,37 @@ +server = $wp_rest_server = new \WP_REST_Server; + do_action( 'rest_api_init' ); + + //add_action( 'init', array($this, 'activate_plugin_via_php' ) ); + } + public function activate_plugin_via_php() { + $active_plugins = get_option( 'active_plugins' ); + array_push($active_plugins, 'tainacan/tainacan.php'); /* Here just replace unyson plugin directory and plugin file*/ + update_option( 'active_plugins', $active_plugins ); + } +} \ No newline at end of file