- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/comment/lastCommentModified.php
r42228 r42343 11 11 12 12 public function test_default_timezone() { 13 self::factory()->comment->create_and_get( array( 14 'comment_status' => 1, 15 'comment_date' => '2000-01-01 11:00:00', 16 'comment_date_gmt' => '2000-01-01 10:00:00', 17 ) ); 13 self::factory()->comment->create_and_get( 14 array( 15 'comment_status' => 1, 16 'comment_date' => '2000-01-01 11:00:00', 17 'comment_date_gmt' => '2000-01-01 10:00:00', 18 ) 19 ); 18 20 19 21 $this->assertSame( strtotime( '2000-01-01 10:00:00' ), strtotime( get_lastcommentmodified() ) ); … … 21 23 22 24 public function test_server_timezone() { 23 self::factory()->comment->create_and_get( array( 24 'comment_status' => 1, 25 'comment_date' => '2000-01-01 11:00:00', 26 'comment_date_gmt' => '2000-01-01 10:00:00', 27 ) ); 25 self::factory()->comment->create_and_get( 26 array( 27 'comment_status' => 1, 28 'comment_date' => '2000-01-01 11:00:00', 29 'comment_date_gmt' => '2000-01-01 10:00:00', 30 ) 31 ); 28 32 29 33 $this->assertSame( strtotime( '2000-01-01 10:00:00' ), strtotime( get_lastcommentmodified() ) ); … … 31 35 32 36 public function test_blog_timezone() { 33 self::factory()->comment->create_and_get( array( 34 'comment_status' => 1, 35 'comment_date' => '2000-01-01 11:00:00', 36 'comment_date_gmt' => '2000-01-01 10:00:00', 37 ) ); 37 self::factory()->comment->create_and_get( 38 array( 39 'comment_status' => 1, 40 'comment_date' => '2000-01-01 11:00:00', 41 'comment_date_gmt' => '2000-01-01 10:00:00', 42 ) 43 ); 38 44 39 45 $this->assertSame( '2000-01-01 11:00:00', get_lastcommentmodified( 'blog' ) ); … … 41 47 42 48 public function test_gmt_timezone() { 43 self::factory()->comment->create_and_get( array( 44 'comment_status' => 1, 45 'comment_date' => '2000-01-01 11:00:00', 46 'comment_date_gmt' => '2000-01-01 10:00:00', 47 ) ); 49 self::factory()->comment->create_and_get( 50 array( 51 'comment_status' => 1, 52 'comment_date' => '2000-01-01 11:00:00', 53 'comment_date_gmt' => '2000-01-01 10:00:00', 54 ) 55 ); 48 56 49 57 $this->assertSame( strtotime( '2000-01-01 10:00:00' ), strtotime( get_lastcommentmodified( 'GMT' ) ) ); … … 51 59 52 60 public function test_unknown_timezone() { 53 self::factory()->comment->create_and_get( array( 54 'comment_status' => 1, 55 'comment_date' => '2000-01-01 11:00:00', 56 'comment_date_gmt' => '2000-01-01 10:00:00', 57 ) ); 61 self::factory()->comment->create_and_get( 62 array( 63 'comment_status' => 1, 64 'comment_date' => '2000-01-01 11:00:00', 65 'comment_date_gmt' => '2000-01-01 10:00:00', 66 ) 67 ); 58 68 59 69 $this->assertFalse( get_lastcommentmodified( 'foo' ) ); … … 61 71 62 72 public function test_data_is_cached() { 63 self::factory()->comment->create_and_get( array( 64 'comment_status' => 1, 65 'comment_date' => '2015-04-01 11:00:00', 66 'comment_date_gmt' => '2015-04-01 10:00:00', 67 ) ); 73 self::factory()->comment->create_and_get( 74 array( 75 'comment_status' => 1, 76 'comment_date' => '2015-04-01 11:00:00', 77 'comment_date_gmt' => '2015-04-01 10:00:00', 78 ) 79 ); 68 80 69 81 get_lastcommentmodified(); … … 72 84 73 85 public function test_cache_is_cleared() { 74 self::factory()->comment->create_and_get( array( 75 'comment_status' => 1, 76 'comment_date' => '2000-01-01 11:00:00', 77 'comment_date_gmt' => '2000-01-01 10:00:00', 78 ) ); 86 self::factory()->comment->create_and_get( 87 array( 88 'comment_status' => 1, 89 'comment_date' => '2000-01-01 11:00:00', 90 'comment_date_gmt' => '2000-01-01 10:00:00', 91 ) 92 ); 79 93 80 94 get_lastcommentmodified(); … … 82 96 $this->assertSame( strtotime( '2000-01-01 10:00:00' ), strtotime( wp_cache_get( 'lastcommentmodified:server', 'timeinfo' ) ) ); 83 97 84 self::factory()->comment->create_and_get( array( 85 'comment_status' => 1, 86 'comment_date' => '2000-01-02 11:00:00', 87 'comment_date_gmt' => '2000-01-02 10:00:00', 88 ) ); 98 self::factory()->comment->create_and_get( 99 array( 100 'comment_status' => 1, 101 'comment_date' => '2000-01-02 11:00:00', 102 'comment_date_gmt' => '2000-01-02 10:00:00', 103 ) 104 ); 89 105 90 106 $this->assertFalse( wp_cache_get( 'lastcommentmodified:server', 'timeinfo' ) ); … … 94 110 95 111 public function test_cache_is_cleared_when_comment_is_trashed() { 96 $comment_1 = self::factory()->comment->create_and_get( array( 97 'comment_status' => 1, 98 'comment_date' => '1998-01-01 11:00:00', 99 'comment_date_gmt' => '1998-01-01 10:00:00', 100 ) ); 112 $comment_1 = self::factory()->comment->create_and_get( 113 array( 114 'comment_status' => 1, 115 'comment_date' => '1998-01-01 11:00:00', 116 'comment_date_gmt' => '1998-01-01 10:00:00', 117 ) 118 ); 101 119 102 $comment_2 = self::factory()->comment->create_and_get( array( 103 'comment_status' => 1, 104 'comment_date' => '2000-01-02 11:00:00', 105 'comment_date_gmt' => '2000-01-02 10:00:00', 106 ) ); 120 $comment_2 = self::factory()->comment->create_and_get( 121 array( 122 'comment_status' => 1, 123 'comment_date' => '2000-01-02 11:00:00', 124 'comment_date_gmt' => '2000-01-02 10:00:00', 125 ) 126 ); 107 127 108 128 get_lastcommentmodified();
Note: See TracChangeset
for help on using the changeset viewer.