bootstrap.php 590 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. if ( file_exists( __DIR__ . '/database.sqlite' ) ) {
  11. unlink( __DIR__ . '/database.sqlite' );
  12. }
  13. touch( __DIR__ . '/database.sqlite' );
  14. // Start up the WP testing environment.
  15. require getenv( 'WP_PHPUNIT__DIR' ) . '/includes/bootstrap.php';