From 4bb79a2ce301ac6aa370273ea44f1908e8e5088f Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 14 Nov 2013 16:50:21 +0000 Subject: [PATCH] Add a unit test to confirm that the version number in readme.html matches version.php. 3.7.1 shipped with 3.7 in the readme. Not a big deal, but this should prevent it in the future. git-svn-id: https://develop.svn.wordpress.org/trunk@26166 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/basic.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/phpunit/tests/basic.php b/tests/phpunit/tests/basic.php index 056af06acc..4110d59b80 100644 --- a/tests/phpunit/tests/basic.php +++ b/tests/phpunit/tests/basic.php @@ -22,6 +22,13 @@ class Tests_Basic extends WP_UnitTestCase { $this->assertTrue($this->val); } + function test_readme() { + $readme = file_get_contents( ABSPATH . 'readme.html' ); + preg_match( '#
Version (.*)#', $readme, $matches ); + list( $version ) = explode( '-', $GLOBALS['wp_version'] ); + $this->assertEquals( $version, $matches[1], "readme.html'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;