diff --git a/tests/phpunit/tutor-pro/ImporterTest.php b/tests/phpunit/tutor-pro/ImporterTest.php new file mode 100644 index 0000000000..121f154fe6 --- /dev/null +++ b/tests/phpunit/tutor-pro/ImporterTest.php @@ -0,0 +1,99 @@ +importer = new \TutorPro\Tools\Importer(); + wp_set_current_user( 1 ); + } + + /** + * Teardown function that runs after the test has ran. + * + * @since 3.6.0 + * + * @return void + */ + protected function tearDown(): void { + unset( $this->importer ); + + parent::tearDown(); + } + + /** + * Test importing json content with importer. + * + * @since 3.6.0 + * + * @return void + */ + public function test_import_json_content() { + $json_data = file_get_contents( '' ); // file path. + + $response = $this->importer->import_contents( $json_data ); + + $this->assertFalse( is_wp_error( $response ) ); + } +}