Changeset 909 in tests for trunk/tests/file.php
- Timestamp:
- 07/19/2012 01:52:37 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/file.php
r904 r909 1 1 <?php 2 2 3 /** 4 * @group file 5 */ 3 6 class Tests_File extends WP_UnitTestCase { 4 7 … … 7 10 8 11 $this->badchars = '"\'[]*&?$'; 12 } 13 14 /** 15 * @group plugins 16 * @group themes 17 */ 18 function test_get_file_data() { 19 $theme_headers = array( 20 'Name' => 'Theme Name', 21 'ThemeURI' => 'Theme URI', 22 'Description' => 'Description', 23 'Version' => 'Version', 24 'Author' => 'Author', 25 'AuthorURI' => 'Author URI', 26 ); 27 28 $actual = get_file_data( DIR_TESTDATA . '/themedir1/default/style.css', $theme_headers ); 29 30 $expected = array( 31 'Name' => 'WordPress Default', 32 'ThemeURI' => 'http://wordpress.org/', 33 'Description' => 'The default WordPress theme based on the famous <a href="http://binarybonsai.com/kubrick/">Kubrick</a>.', 34 'Version' => '1.6', 35 'Author' => 'Michael Heilemann', 36 'AuthorURI' => 'http://binarybonsai.com/', 37 ); 38 39 foreach ( $actual as $header => $value ) 40 $this->assertEquals( $expected[ $header ], $value, $header ); 41 } 42 43 /** 44 * @group plugins 45 * @group themes 46 */ 47 function test_get_file_data_cr_line_endings() { 48 $headers = array( 'SomeHeader' => 'Some Header', 'Description' => 'Description', 'Author' => 'Author' ); 49 $actual = get_file_data( DIR_TESTDATA . '/formatting/cr-line-endings-file-header.php', $headers ); 50 $expected = array( 51 'SomeHeader' => 'Some header value!', 52 'Description' => 'This file is using CR line endings for a testcase.', 53 'Author' => 'A Very Old Mac', 54 ); 55 56 foreach ( $actual as $header => $value ) 57 $this->assertEquals( $expected[ $header ], $value, $header ); 9 58 } 10 59
Note: See TracChangeset
for help on using the changeset viewer.