Changeset 40246
- Timestamp:
- 03/08/2017 12:42:13 AM (9 years ago)
- Location:
- branches/4.1
- 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/4.1
-
branches/4.1/tests/phpunit/includes/testcase.php
r30687 r40246 78 78 $_POST = array(); 79 79 $this->flush_cache(); 80 } 81 82 /** 83 * Allow tests to be skipped on some automated runs 84 * 85 * For test runs on Travis for something other than trunk/master 86 * we want to skip tests that only need to run for master. 87 */ 88 public function skipOnAutomatedBranches() { 89 // gentenv can be disabled 90 if ( ! function_exists( 'getenv' ) ) { 91 return false; 92 } 93 94 // https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables 95 $travis_branch = getenv( 'TRAVIS_BRANCH' ); 96 $travis_pull_request = getenv( 'TRAVIS_PULL_REQUEST' ); 97 98 if ( false !== $travis_pull_request && 'master' !== $travis_branch ) { 99 $this->markTestSkipped( 'For automated test runs, this test is only run on trunk/master' ); 100 } 80 101 } 81 102 -
branches/4.1/tests/phpunit/tests/basic.php
r32147 r40246 30 30 31 31 function test_license() { 32 // This test is designed to only run on trunk/master 33 $this->skipOnAutomatedBranches(); 34 32 35 $license = file_get_contents( ABSPATH . 'license.txt' ); 33 36 preg_match( '#Copyright (\d+) by the contributors#', $license, $matches );
Note: See TracChangeset
for help on using the changeset viewer.