Changeset 45378 for trunk/tests/phpunit/tests/date/theDate.php
- Timestamp:
- 05/22/2019 09:57:29 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/date/theDate.php
r43591 r45378 82 82 return $input; 83 83 } 84 85 /** 86 * @ticket 33750 87 */ 88 function test_the_date() { 89 ob_start(); 90 the_date(); 91 $actual = ob_get_clean(); 92 $this->assertEquals( '', $actual ); 93 94 $GLOBALS['post'] = self::factory()->post->create_and_get( 95 array( 96 'post_date' => '2015-09-16 08:00:00', 97 ) 98 ); 99 100 ob_start(); 101 $GLOBALS['currentday'] = '18.09.15'; 102 $GLOBALS['previousday'] = '17.09.15'; 103 the_date(); 104 $this->assertEquals( 'September 16, 2015', ob_get_clean() ); 105 106 ob_start(); 107 $GLOBALS['currentday'] = '18.09.15'; 108 $GLOBALS['previousday'] = '17.09.15'; 109 the_date( 'Y' ); 110 $this->assertEquals( '2015', ob_get_clean() ); 111 112 ob_start(); 113 $GLOBALS['currentday'] = '18.09.15'; 114 $GLOBALS['previousday'] = '17.09.15'; 115 the_date( 'Y', 'before ', ' after' ); 116 $this->assertEquals( 'before 2015 after', ob_get_clean() ); 117 118 ob_start(); 119 $GLOBALS['currentday'] = '18.09.15'; 120 $GLOBALS['previousday'] = '17.09.15'; 121 the_date( 'Y', 'before ', ' after', false ); 122 $this->assertEquals( '', ob_get_clean() ); 123 } 124 125 /** 126 * @ticket 47354 127 */ 128 function test_the_weekday_date() { 129 ob_start(); 130 the_weekday_date(); 131 $actual = ob_get_clean(); 132 $this->assertEquals( '', $actual ); 133 134 $GLOBALS['post'] = self::factory()->post->create_and_get( 135 array( 136 'post_date' => '2015-09-16 08:00:00', 137 ) 138 ); 139 140 ob_start(); 141 $GLOBALS['currentday'] = '18.09.15'; 142 $GLOBALS['previousday'] = '17.09.15'; 143 the_weekday_date(); 144 $this->assertEquals( 'Wednesday', ob_get_clean() ); 145 146 ob_start(); 147 $GLOBALS['currentday'] = '18.09.15'; 148 $GLOBALS['previousday'] = '17.09.15'; 149 the_weekday_date( 'before ', ' after' ); 150 $this->assertEquals( 'before Wednesday after', ob_get_clean() ); 151 } 84 152 }
Note: See TracChangeset
for help on using the changeset viewer.