Changeset 45378 for trunk/tests/phpunit/tests/functions.php
- Timestamp:
- 05/22/2019 09:57:29 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/functions.php
r45270 r45378 914 914 $json = wp_json_encode( $data, 0, 1 ); 915 915 $this->assertFalse( $json ); 916 }917 918 /**919 * @ticket 33750920 */921 function test_the_date() {922 ob_start();923 the_date();924 $actual = ob_get_clean();925 $this->assertEquals( '', $actual );926 927 $GLOBALS['post'] = self::factory()->post->create_and_get(928 array(929 'post_date' => '2015-09-16 08:00:00',930 )931 );932 933 ob_start();934 $GLOBALS['currentday'] = '18.09.15';935 $GLOBALS['previousday'] = '17.09.15';936 the_date();937 $this->assertEquals( 'September 16, 2015', ob_get_clean() );938 939 ob_start();940 $GLOBALS['currentday'] = '18.09.15';941 $GLOBALS['previousday'] = '17.09.15';942 the_date( 'Y' );943 $this->assertEquals( '2015', ob_get_clean() );944 945 ob_start();946 $GLOBALS['currentday'] = '18.09.15';947 $GLOBALS['previousday'] = '17.09.15';948 the_date( 'Y', 'before ', ' after' );949 $this->assertEquals( 'before 2015 after', ob_get_clean() );950 951 ob_start();952 $GLOBALS['currentday'] = '18.09.15';953 $GLOBALS['previousday'] = '17.09.15';954 the_date( 'Y', 'before ', ' after', false );955 $this->assertEquals( '', ob_get_clean() );956 916 } 957 917
Note: See TracChangeset
for help on using the changeset viewer.