bootstrap.php 596 B

12345678910111213141516171819
  1. <?php
  2. /**
  3. * PHPUnit bootstrap file
  4. */
  5. // Set full path to WP tests config.
  6. putenv( sprintf( 'WP_PHPUNIT__TESTS_CONFIG=%s', __DIR__ . '/wp-config.php' ) );
  7. // Composer autoloader must be loaded before WP_PHPUNIT__DIR will be available
  8. require_once dirname( __DIR__ ) . '/vendor/autoload.php';
  9. // Reset the DB file completely before each run.
  10. $db_handle = fopen( __DIR__ . '/test-wp-content/database.sqlite', 'w' );
  11. ftruncate( $db_handle, 0 );
  12. fclose( $db_handle );
  13. unset( $db_handle );
  14. // Start up the WP testing environment.
  15. require getenv( 'WP_PHPUNIT__DIR' ) . '/includes/bootstrap.php';