Build/Test tools: In Travis, skip some tests when not on trunk.

This skips time sensitive tests (copyright year and PHP/MySQL version requirements) when tests are run on branches on Travis.

Props netweb, jorbin

Fixes #39486


git-svn-id: https://develop.svn.wordpress.org/trunk@40241 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn
2017-03-08 00:06:12 +00:00
parent 0060ffaa8c
commit 74e02a21b8
3 changed files with 27 additions and 0 deletions

View File

@@ -8,6 +8,9 @@
class Tests_Basic extends WP_UnitTestCase {
function test_license() {
// This test is designed to only run on trunk/master
$this->skipOnAutomatedBranches();
$license = file_get_contents( ABSPATH . 'license.txt' );
preg_match( '#Copyright 2011-(\d+) by the contributors#', $license, $matches );
$this_year = date( 'Y' );