Changeset 59327
- Timestamp:
- 10/30/2024 11:45:53 PM (5 weeks ago)
- Location:
- branches/6.7
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.7
-
branches/6.7/tests/phpunit/includes/bootstrap.php
r59086 r59327 217 217 define( 'IMPORTER_PLUGIN_FOR_TESTS', DIR_TESTDATA . '/plugins/wordpress-importer/wordpress-importer.php' ); 218 218 219 if ( defined( 'WP_RUN_CORE_TESTS' ) && WP_RUN_CORE_TESTS && ! 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 }224 225 219 define( 'WP_LANG_DIR', realpath( DIR_TESTDATA . '/languages' ) ); 226 220 -
branches/6.7/tests/phpunit/tests/import/base.php
r56549 r59327 2 2 3 3 abstract class WP_Import_UnitTestCase extends WP_UnitTestCase { 4 5 /** 6 * Require the WordPress Importer plugin. 7 * 8 * Fails the test if the plugin is not installed. 9 */ 10 protected function require_importer() { 11 if ( ! file_exists( IMPORTER_PLUGIN_FOR_TESTS ) ) { 12 $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' ); 13 } 14 require_once IMPORTER_PLUGIN_FOR_TESTS; 15 } 16 4 17 /** 5 18 * Import a WXR file. … … 22 35 */ 23 36 protected function _import_wp( $filename, $users = array(), $fetch_files = true ) { 37 $this->require_importer(); 38 24 39 $importer = new WP_Import(); 25 40 $file = realpath( $filename ); -
branches/6.7/tests/phpunit/tests/import/import.php
r59085 r59327 22 22 add_filter( 'import_allow_create_users', '__return_true' ); 23 23 24 require_once IMPORTER_PLUGIN_FOR_TESTS;24 $this->require_importer(); 25 25 26 26 // Crude but effective: make sure there's no residual data in the main tables. -
branches/6.7/tests/phpunit/tests/import/parser.php
r59168 r59327 18 18 } 19 19 20 require_once IMPORTER_PLUGIN_FOR_TESTS;20 $this->require_importer(); 21 21 } 22 22 -
branches/6.7/tests/phpunit/tests/import/postmeta.php
r59085 r59327 20 20 } 21 21 22 require_once IMPORTER_PLUGIN_FOR_TESTS;22 $this->require_importer(); 23 23 } 24 24
Note: See TracChangeset
for help on using the changeset viewer.