From 146bcccaa22028fe509b760b1f4651ddcfe5d4e7 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 13 Jan 2014 18:20:38 +0000 Subject: [PATCH] Update package.json. props TobiasBg. fixes #26629. git-svn-id: https://develop.svn.wordpress.org/trunk@26940 602fd350-edb4-49c9-b593-d223f7449a82 --- package.json | 2 +- tests/phpunit/tests/basic.php | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e836edf839..fcb2ad98c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "WordPress", - "version": "3.7.0", + "version": "3.9.0", "description": "WordPress is web software you can use to create a beautiful website or blog.", "repository": { "type": "svn", diff --git a/tests/phpunit/tests/basic.php b/tests/phpunit/tests/basic.php index d5aba28b9d..e66f75d0a9 100644 --- a/tests/phpunit/tests/basic.php +++ b/tests/phpunit/tests/basic.php @@ -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;