- Timestamp:
- 10/15/2021 10:52:43 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/functions/cleanDirsizeCache.php
r51910 r51911 4 4 * Tests specific to the directory size caching. 5 5 * 6 * @covers ::clean_dirsize_cache7 6 * @group functions.php 8 7 */ … … 13 12 * 14 13 * @ticket 52241 14 * 15 * @covers ::clean_dirsize_cache 15 16 * 16 17 * @dataProvider data_clean_dirsize_cache_with_invalid_inputs … … 56 57 * 57 58 * @ticket 52241 59 * 60 * @covers ::clean_dirsize_cache 58 61 * 59 62 * @dataProvider data_clean_dirsize_cache_with_non_path_string … … 101 104 ); 102 105 } 106 107 /** 108 * Test the behaviour of the function when the transient doesn't exist. 109 * 110 * @ticket 52241 111 * @ticket 53635 112 * 113 * @covers ::recurse_dirsize 114 */ 115 public function test_recurse_dirsize_without_transient() { 116 delete_transient( 'dirsize_cache' ); 117 118 $size = recurse_dirsize( __DIR__ . '/fixtures' ); 119 120 $this->assertGreaterThan( 10, $size ); 121 } 122 123 /** 124 * Test the behaviour of the function when the transient does exist, but is not an array. 125 * 126 * In particular, this tests that no PHP TypeErrors are being thrown. 127 * 128 * @ticket 52241 129 * @ticket 53635 130 * 131 * @covers ::recurse_dirsize 132 */ 133 public function test_recurse_dirsize_with_invalid_transient() { 134 set_transient( 'dirsize_cache', 'this is not a valid transient for dirsize cache' ); 135 136 $size = recurse_dirsize( __DIR__ . '/fixtures' ); 137 138 $this->assertGreaterThan( 10, $size ); 139 } 103 140 }
Note: See TracChangeset
for help on using the changeset viewer.