Skip to content

Commit

Permalink
Merge pull request #19 from wp-cli/18-fix-phpunit-version-fetching
Browse files Browse the repository at this point in the history
Fix fetching the VERSION file from the framework
  • Loading branch information
schlessera authored Aug 23, 2018
2 parents 894c765 + f8a0544 commit da807cf
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,19 @@
? WP_CLI_TESTS_ROOT . '/vendor'
: WP_CLI_TESTS_ROOT . '/../..'
);
define( 'WP_CLI_ROOT', VENDOR_DIR . '/wp-cli/wp-cli' );
define( 'PACKAGE_ROOT', VENDOR_DIR . '/..' );
define( 'WP_CLI_VERSION', trim( file_get_contents( WP_CLI_ROOT . '/VERSION' ) ) );

define( 'WP_CLI_ROOT',
is_readable( PACKAGE_ROOT . '/VERSION' )
? PACKAGE_ROOT
: VENDOR_DIR . '/wp-cli/wp-cli'
);

define( 'WP_CLI_VERSION',
is_readable( WP_CLI_ROOT . '/VERSION' )
? trim( file_get_contents( WP_CLI_ROOT . '/VERSION' ) )
: define( 'WP_CLI_VERSION', '2.x.x' )
);

/**
* Compatibility with PHPUnit 6+
Expand Down

0 comments on commit da807cf

Please sign in to comment.