Changeset 52010 for trunk/tests/phpunit/tests/file.php
- Timestamp:
- 11/04/2021 03:22:47 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/file.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/file.php
r51568 r52010 6 6 class Tests_File extends WP_UnitTestCase { 7 7 8 function set_up() {8 public function set_up() { 9 9 parent::set_up(); 10 10 … … 18 18 * @group themes 19 19 */ 20 function test_get_file_data() {20 public function test_get_file_data() { 21 21 $theme_headers = array( 22 22 'Name' => 'Theme Name', … … 49 49 * @group themes 50 50 */ 51 function test_get_file_data_with_cr_line_endings() {51 public function test_get_file_data_with_cr_line_endings() { 52 52 $headers = array( 53 53 'SomeHeader' => 'Some Header', … … 73 73 * @group themes 74 74 */ 75 function test_get_file_data_with_php_open_tag_prefix() {75 public function test_get_file_data_with_php_open_tag_prefix() { 76 76 $headers = array( 77 77 'TemplateName' => 'Template Name', … … 88 88 } 89 89 90 function is_unique_writable_file( $path, $filename ) {90 private function is_unique_writable_file( $path, $filename ) { 91 91 $fullpath = $path . DIRECTORY_SEPARATOR . $filename; 92 92 … … 111 111 } 112 112 113 function test_unique_filename_is_valid() {113 public function test_unique_filename_is_valid() { 114 114 // Make sure it produces a valid, writable, unique filename. 115 115 $filename = wp_unique_filename( $this->dir, __FUNCTION__ . '.txt' ); … … 120 120 } 121 121 122 function test_unique_filename_is_unique() {122 public function test_unique_filename_is_unique() { 123 123 // Make sure it produces two unique filenames. 124 124 $name = __FUNCTION__; … … 136 136 } 137 137 138 function test_unique_filename_is_sanitized() {138 public function test_unique_filename_is_sanitized() { 139 139 $name = __FUNCTION__; 140 140 $filename = wp_unique_filename( $this->dir, $name . $this->badchars . '.txt' ); … … 148 148 } 149 149 150 function test_unique_filename_with_slashes() {150 public function test_unique_filename_with_slashes() { 151 151 $name = __FUNCTION__; 152 152 // "foo/foo.txt" … … 161 161 } 162 162 163 function test_unique_filename_multiple_ext() {163 public function test_unique_filename_multiple_ext() { 164 164 $name = __FUNCTION__; 165 165 $filename = wp_unique_filename( $this->dir, $name . '.php.txt' ); … … 173 173 } 174 174 175 function test_unique_filename_no_ext() {175 public function test_unique_filename_no_ext() { 176 176 $name = __FUNCTION__; 177 177 $filename = wp_unique_filename( $this->dir, $name ); … … 187 187 * @dataProvider data_wp_tempnam_filenames 188 188 */ 189 function test_wp_tempnam( $case ) {189 public function test_wp_tempnam( $case ) { 190 190 $file = wp_tempnam( $case ); 191 191 unlink( $file ); … … 193 193 $this->assertNotEmpty( basename( basename( $file, '.tmp' ), '.zip' ) ); 194 194 } 195 function data_wp_tempnam_filenames() {195 public function data_wp_tempnam_filenames() { 196 196 return array( 197 197 array( '0.zip' ), … … 207 207 * @ticket 47186 208 208 */ 209 function test_file_signature_functions_as_expected() {209 public function test_file_signature_functions_as_expected() { 210 210 $file = wp_tempnam(); 211 211 file_put_contents( $file, 'WordPress' ); … … 240 240 * @ticket 47186 241 241 */ 242 function test_file_signature_expected_failure() {242 public function test_file_signature_expected_failure() { 243 243 $file = wp_tempnam(); 244 244 file_put_contents( $file, 'WordPress' ); … … 257 257 } 258 258 259 function filter_trust_plus85Tq_key( $keys ) {259 public function filter_trust_plus85Tq_key( $keys ) { 260 260 // A static once-off key used to verify verify_file_signature() works as expected. 261 261 $keys[] = '+85TqMhxQVAYVW4BSCVkJQvZH4q7z8I9lePbvngvf7A=';
Note: See TracChangeset
for help on using the changeset viewer.