Changeset 59085
- Timestamp:
- 09/24/2024 06:09:41 PM (4 months ago)
- Location:
- trunk/tests/phpunit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/bootstrap.php
r56552 r59085 215 215 define( 'DIR_TESTDATA', __DIR__ . '/../data' ); 216 216 define( 'DIR_TESTROOT', realpath( dirname( __DIR__ ) ) ); 217 define( 'IMPORTER_PLUGIN_FOR_TESTS', DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php' ); 218 219 if ( ! file_exists( IMPORTER_PLUGIN_FOR_TESTS ) ) { 220 echo 'The test suite requires the WordPress Importer plugin to be available in the `/data/plugins/` directory.' 221 . ' See: https://make.wordpress.org/core/handbook/contribute/git/#unit-tests' . PHP_EOL, 222 exit( 1 ); 223 } 217 224 218 225 define( 'WP_LANG_DIR', realpath( DIR_TESTDATA . '/languages' ) ); -
trunk/tests/phpunit/tests/import/import.php
r56738 r59085 8 8 class Tests_Import_Import extends WP_Import_UnitTestCase { 9 9 public function set_up() { 10 global $wpdb; 11 10 12 parent::set_up(); 11 13 … … 20 22 add_filter( 'import_allow_create_users', '__return_true' ); 21 23 22 if ( ! file_exists( DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php' ) ) { 23 $this->fail( 'This test requires the WordPress Importer plugin to be installed in the test suite. See: https://make.wordpress.org/core/handbook/contribute/git/#unit-tests' ); 24 } 25 26 require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php'; 27 28 global $wpdb; 24 require_once IMPORTER_PLUGIN_FOR_TESTS; 25 29 26 // Crude but effective: make sure there's no residual data in the main tables. 30 27 foreach ( array( 'posts', 'postmeta', 'comments', 'terms', 'term_taxonomy', 'term_relationships', 'users', 'usermeta' ) as $table ) { -
trunk/tests/phpunit/tests/import/parser.php
r54891 r59085 18 18 } 19 19 20 if ( ! file_exists( DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php' ) ) { 21 $this->fail( 'This test requires the WordPress Importer plugin to be installed in the test suite. See: https://make.wordpress.org/core/handbook/contribute/git/#unit-tests' ); 22 } 23 24 require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php'; 20 require_once IMPORTER_PLUGIN_FOR_TESTS; 25 21 } 26 22 -
trunk/tests/phpunit/tests/import/postmeta.php
r54402 r59085 20 20 } 21 21 22 if ( ! file_exists( DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php' ) ) { 23 $this->fail( 'This test requires the WordPress Importer plugin to be installed in the test suite. See: https://make.wordpress.org/core/handbook/contribute/git/#unit-tests' ); 24 } 25 26 require_once DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php'; 22 require_once IMPORTER_PLUGIN_FOR_TESTS; 27 23 } 28 24
Note: See TracChangeset
for help on using the changeset viewer.