Changeset 40248
- Timestamp:
- 03/08/2017 12:47:48 AM (9 years ago)
- Location:
- branches/3.9
- Files:
-
- 3 edited
-
. (modified) (1 prop)
-
tests/phpunit/includes/testcase.php (modified) (1 diff)
-
tests/phpunit/tests/basic.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.9
-
branches/3.9/tests/phpunit/includes/testcase.php
r27795 r40248 48 48 $_POST = array(); 49 49 $this->flush_cache(); 50 } 51 52 /** 53 * Allow tests to be skipped on some automated runs 54 * 55 * For test runs on Travis for something other than trunk/master 56 * we want to skip tests that only need to run for master. 57 */ 58 public function skipOnAutomatedBranches() { 59 // gentenv can be disabled 60 if ( ! function_exists( 'getenv' ) ) { 61 return false; 62 } 63 64 // https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables 65 $travis_branch = getenv( 'TRAVIS_BRANCH' ); 66 $travis_pull_request = getenv( 'TRAVIS_PULL_REQUEST' ); 67 68 if ( false !== $travis_pull_request && 'master' !== $travis_branch ) { 69 $this->markTestSkipped( 'For automated test runs, this test is only run on trunk/master' ); 70 } 50 71 } 51 72 -
branches/3.9/tests/phpunit/tests/basic.php
r32149 r40248 31 31 32 32 function test_license() { 33 // This test is designed to only run on trunk/master 34 $this->skipOnAutomatedBranches(); 35 33 36 $license = file_get_contents( ABSPATH . 'license.txt' ); 34 37 preg_match( '#Copyright (\d+) by the contributors#', $license, $matches );
Note: See TracChangeset
for help on using the changeset viewer.