forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Divide tests into two files and improve covers
- Loading branch information
1 parent
4fe7851
commit 0960481
Showing
2 changed files
with
42 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* @group modules | ||
* @covers WP_Modules::get_version_query_string | ||
*/ | ||
class Tests_WP_Modules extends WP_UnitTestCase { | ||
/** | ||
* Tests the functionality of the `get_version_query_string` method to ensure | ||
* proper version strings are returned. | ||
* | ||
* @ticket 56313 | ||
* | ||
* @covers WP_Modules::get_version_query_string | ||
*/ | ||
public function test_get_version_query_string() { | ||
$get_version_query_string = new ReflectionMethod( 'WP_Modules', 'get_version_query_string' ); | ||
$get_version_query_string->setAccessible( true ); | ||
|
||
$result = $get_version_query_string->invoke( null, '1.0' ); | ||
$this->assertEquals( '?ver=1.0', $result ); | ||
|
||
$result = $get_version_query_string->invoke( null, false ); | ||
$this->assertEquals( '?ver=' . get_bloginfo( 'version' ), $result ); | ||
|
||
$result = $get_version_query_string->invoke( null, null ); | ||
$this->assertEquals( '', $result ); | ||
} | ||
} |