Tests: Move the tests for get_the_modified_time() to a more appropriate place.

Add some new tests to better cover the functionality, for consistency with `get_the_date()` and `get_the_time()`.

Follow-up to [48911], [48912], [48918].

Props wittich.
Fixes #51184.

git-svn-id: https://develop.svn.wordpress.org/trunk@48924 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-08-31 22:41:02 +00:00
parent 23528d419a
commit 699e44cc76
4 changed files with 201 additions and 152 deletions

View File

@@ -10,7 +10,7 @@ class Tests_Date_Get_Comment_Date extends WP_UnitTestCase {
/**
* @ticket 51184
*/
function test_get_comment_date_returns_correct_time_with_comment_id() {
public function test_get_comment_date_returns_correct_time_with_comment_id() {
$c = self::factory()->comment->create( array( 'comment_date' => '2020-08-29 01:51:00' ) );
$this->assertEquals( 'August 29, 2020', get_comment_date( 'F j, Y', $c ) );
@@ -19,7 +19,7 @@ class Tests_Date_Get_Comment_Date extends WP_UnitTestCase {
/**
* @ticket 51184
*/
function test_get_comment_date_returns_correct_time_with_empty_format() {
public function test_get_comment_date_returns_correct_time_with_empty_format() {
$c = self::factory()->comment->create( array( 'comment_date' => '2020-08-29 01:51:00' ) );
$this->assertEquals( 'August 29, 2020', get_comment_date( '', $c ) );
@@ -29,7 +29,7 @@ class Tests_Date_Get_Comment_Date extends WP_UnitTestCase {
/**
* @ticket 51184
*/
function test_get_comment_time_returns_correct_time() {
public function test_get_comment_time_returns_correct_time() {
$c = self::factory()->comment->create( array( 'comment_date' => '2020-08-29 01:51:00' ) );
$GLOBALS['comment'] = get_comment( $c );
@@ -39,7 +39,7 @@ class Tests_Date_Get_Comment_Date extends WP_UnitTestCase {
/**
* @ticket 51184
*/
function test_get_comment_time_returns_correct_time_with_empty_format() {
public function test_get_comment_time_returns_correct_time_with_empty_format() {
$c = self::factory()->comment->create( array( 'comment_date' => '2020-08-29 01:51:00' ) );
$GLOBALS['comment'] = get_comment( $c );