mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 10:44:26 +00:00
Update package.json. props TobiasBg. fixes #26629.
git-svn-id: https://develop.svn.wordpress.org/trunk@26940 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -29,6 +29,17 @@ class Tests_Basic extends WP_UnitTestCase {
|
||||
$this->assertEquals( $version, trim( $matches[1] ), "readme.html's version needs to be updated to $version." );
|
||||
}
|
||||
|
||||
function test_package_json() {
|
||||
$package_json = file_get_contents( dirname( ABSPATH ) . '/package.json' );
|
||||
$package_json = json_decode( $package_json, true );
|
||||
list( $version ) = explode( '-', $GLOBALS['wp_version'] );
|
||||
// package.json uses x.y.z, so fill cleaned $wp_version for .0 releases
|
||||
if ( 1 == substr_count( $version, '.' ) ) {
|
||||
$version .= '.0';
|
||||
}
|
||||
$this->assertEquals( $version, $package_json['version'], "package.json's version needs to be updated to $version." );
|
||||
}
|
||||
|
||||
// two tests for a lame bug in PHPUnit that broke the $GLOBALS reference
|
||||
function test_globals() {
|
||||
global $test_foo;
|
||||
|
||||
Reference in New Issue
Block a user