Changeset 47338 for branches/3.8/tests/phpunit/tests/basic.php
- Timestamp:
- 02/21/2020 01:05:39 PM (5 years ago)
- Location:
- branches/3.8
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.8
- Property svn:mergeinfo changed
-
branches/3.8/tests/phpunit/tests/basic.php
r42098 r47338 21 21 function test_true() { 22 22 $this->assertTrue($this->val); 23 } 24 25 function test_license() { 26 // This test is designed to only run on trunk/master 27 $this->skipOnAutomatedBranches(); 28 29 $license = file_get_contents( ABSPATH . 'license.txt' ); 30 preg_match( '#Copyright 2011-(\d+) by the contributors#', $license, $matches ); 31 $this_year = date( 'Y' ); 32 $this->assertEquals( $this_year, trim( $matches[1] ), "license.txt's year needs to be updated to $this_year." ); 33 } 34 35 function test_package_json() { 36 $package_json = file_get_contents( dirname( ABSPATH ) . '/package.json' ); 37 $package_json = json_decode( $package_json, true ); 38 list( $version ) = explode( '-', $GLOBALS['wp_version'] ); 39 // package.json uses x.y.z, so fill cleaned $wp_version for .0 releases 40 if ( 1 == substr_count( $version, '.' ) ) { 41 $version .= '.0'; 42 } 43 $this->assertEquals( $version, $package_json['version'], "package.json's version needs to be updated to $version." ); 23 44 } 24 45
Note: See TracChangeset
for help on using the changeset viewer.