| 32 | function test_package_json() { |
| 33 | $package_json = file_get_contents( dirname( ABSPATH ) . '/package.json' ); |
| 34 | $package_json = json_decode( $package_json , true ); |
| 35 | list( $version ) = explode( '-', $GLOBALS['wp_version'] ); |
| 36 | // package.json uses x.y.z, so fill cleaned $wp_version for .0 releases |
| 37 | if ( 1 == substr_count( $version, '.' ) ) { |
| 38 | $version .= '.0'; |
| 39 | } |
| 40 | $this->assertEquals( $version, $package_json['version'], "package.json's version needs to be updated to $version." ); |
| 41 | } |
| 42 | |