Changeset 48937 for trunk/tests/phpunit/tests/theme/themeDir.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme/themeDir.php
r47921 r48937 47 47 $themes = get_themes(); 48 48 $theme = get_theme( 'WordPress Default' ); 49 $this->assert Equals( $themes['WordPress Default'], $theme );49 $this->assertSame( $themes['WordPress Default'], $theme ); 50 50 51 51 $this->assertFalse( empty( $theme ) ); … … 53 53 // echo gen_tests_array( 'theme', $theme ); 54 54 55 $this->assert Equals( 'WordPress Default', $theme['Name'] );56 $this->assert Equals( 'WordPress Default', $theme['Title'] );57 $this->assert Equals( 'The default WordPress theme based on the famous <a href="http://binarybonsai.com/kubrick/">Kubrick</a>.', $theme['Description'] );58 $this->assert Equals( '<a href="http://binarybonsai.com/">Michael Heilemann</a>', $theme['Author'] );59 $this->assert Equals( '1.6', $theme['Version'] );60 $this->assert Equals( 'default', $theme['Template'] );61 $this->assert Equals( 'default', $theme['Stylesheet'] );55 $this->assertSame( 'WordPress Default', $theme['Name'] ); 56 $this->assertSame( 'WordPress Default', $theme['Title'] ); 57 $this->assertSame( 'The default WordPress theme based on the famous <a href="http://binarybonsai.com/kubrick/">Kubrick</a>.', $theme['Description'] ); 58 $this->assertSame( '<a href="http://binarybonsai.com/">Michael Heilemann</a>', $theme['Author'] ); 59 $this->assertSame( '1.6', $theme['Version'] ); 60 $this->assertSame( 'default', $theme['Template'] ); 61 $this->assertSame( 'default', $theme['Stylesheet'] ); 62 62 63 63 $this->assertContains( $this->theme_root . '/default/functions.php', $theme['Template Files'] ); … … 65 65 $this->assertContains( $this->theme_root . '/default/style.css', $theme['Stylesheet Files'] ); 66 66 67 $this->assert Equals( $this->theme_root . '/default', $theme['Template Dir'] );68 $this->assert Equals( $this->theme_root . '/default', $theme['Stylesheet Dir'] );69 $this->assert Equals( 'publish', $theme['Status'] );70 $this->assert Equals( '', $theme['Parent Theme'] );67 $this->assertSame( $this->theme_root . '/default', $theme['Template Dir'] ); 68 $this->assertSame( $this->theme_root . '/default', $theme['Stylesheet Dir'] ); 69 $this->assertSame( 'publish', $theme['Status'] ); 70 $this->assertSame( '', $theme['Parent Theme'] ); 71 71 } 72 72 … … 82 82 // echo gen_tests_array( 'theme', $theme ); 83 83 84 $this->assert Equals( 'Sandbox', $theme['Name'] );85 $this->assert Equals( 'Sandbox', $theme['Title'] );86 $this->assert Equals( 'A theme with powerful, semantic CSS selectors and the ability to add new skins.', $theme['Description'] );87 $this->assert Equals( '<a href="http://andy.wordpress.com/">Andy Skelton</a> & <a href="http://www.plaintxt.org/">Scott Allan Wallick</a>', $theme['Author'] );88 $this->assert Equals( '0.6.1-wpcom', $theme['Version'] );89 $this->assert Equals( 'sandbox', $theme['Template'] );90 $this->assert Equals( 'sandbox', $theme['Stylesheet'] );84 $this->assertSame( 'Sandbox', $theme['Name'] ); 85 $this->assertSame( 'Sandbox', $theme['Title'] ); 86 $this->assertSame( 'A theme with powerful, semantic CSS selectors and the ability to add new skins.', $theme['Description'] ); 87 $this->assertSame( '<a href="http://andy.wordpress.com/">Andy Skelton</a> & <a href="http://www.plaintxt.org/">Scott Allan Wallick</a>', $theme['Author'] ); 88 $this->assertSame( '0.6.1-wpcom', $theme['Version'] ); 89 $this->assertSame( 'sandbox', $theme['Template'] ); 90 $this->assertSame( 'sandbox', $theme['Stylesheet'] ); 91 91 92 92 $template_files = $theme['Template Files']; 93 93 94 $this->assert Equals( $this->theme_root . '/sandbox/functions.php', reset( $template_files ) );95 $this->assert Equals( $this->theme_root . '/sandbox/index.php', next( $template_files ) );94 $this->assertSame( $this->theme_root . '/sandbox/functions.php', reset( $template_files ) ); 95 $this->assertSame( $this->theme_root . '/sandbox/index.php', next( $template_files ) ); 96 96 97 97 $stylesheet_files = $theme['Stylesheet Files']; 98 98 99 $this->assert Equals( $this->theme_root . '/sandbox/style.css', reset( $stylesheet_files ) );100 101 $this->assert Equals( $this->theme_root . '/sandbox', $theme['Template Dir'] );102 $this->assert Equals( $this->theme_root . '/sandbox', $theme['Stylesheet Dir'] );103 $this->assert Equals( 'publish', $theme['Status'] );104 $this->assert Equals( '', $theme['Parent Theme'] );99 $this->assertSame( $this->theme_root . '/sandbox/style.css', reset( $stylesheet_files ) ); 100 101 $this->assertSame( $this->theme_root . '/sandbox', $theme['Template Dir'] ); 102 $this->assertSame( $this->theme_root . '/sandbox', $theme['Stylesheet Dir'] ); 103 $this->assertSame( 'publish', $theme['Status'] ); 104 $this->assertSame( '', $theme['Parent Theme'] ); 105 105 106 106 } … … 119 119 // echo gen_tests_array( 'theme', $theme ); 120 120 121 $this->assert Equals( 'Stylesheet Only', $theme['Name'] );122 $this->assert Equals( 'Stylesheet Only', $theme['Title'] );123 $this->assert Equals( 'A three-column widget-ready theme in dark blue.', $theme['Description'] );124 $this->assert Equals( '<a href="http://www.example.com/">Henry Crun</a>', $theme['Author'] );125 $this->assert Equals( '1.0', $theme['Version'] );126 $this->assert Equals( 'sandbox', $theme['Template'] );127 $this->assert Equals( 'stylesheetonly', $theme['Stylesheet'] );121 $this->assertSame( 'Stylesheet Only', $theme['Name'] ); 122 $this->assertSame( 'Stylesheet Only', $theme['Title'] ); 123 $this->assertSame( 'A three-column widget-ready theme in dark blue.', $theme['Description'] ); 124 $this->assertSame( '<a href="http://www.example.com/">Henry Crun</a>', $theme['Author'] ); 125 $this->assertSame( '1.0', $theme['Version'] ); 126 $this->assertSame( 'sandbox', $theme['Template'] ); 127 $this->assertSame( 'stylesheetonly', $theme['Stylesheet'] ); 128 128 $this->assertContains( $this->theme_root . '/sandbox/functions.php', $theme['Template Files'] ); 129 129 $this->assertContains( $this->theme_root . '/sandbox/index.php', $theme['Template Files'] ); … … 131 131 $this->assertContains( $this->theme_root . '/stylesheetonly/style.css', $theme['Stylesheet Files'] ); 132 132 133 $this->assert Equals( $this->theme_root . '/sandbox', $theme['Template Dir'] );134 $this->assert Equals( $this->theme_root . '/stylesheetonly', $theme['Stylesheet Dir'] );135 $this->assert Equals( 'publish', $theme['Status'] );136 $this->assert Equals( 'Sandbox', $theme['Parent Theme'] );133 $this->assertSame( $this->theme_root . '/sandbox', $theme['Template Dir'] ); 134 $this->assertSame( $this->theme_root . '/stylesheetonly', $theme['Stylesheet Dir'] ); 135 $this->assertSame( 'publish', $theme['Status'] ); 136 $this->assertSame( 'Sandbox', $theme['Parent Theme'] ); 137 137 138 138 } … … 170 170 sort( $expected ); 171 171 172 $this->assert Equals( $expected, $theme_names );172 $this->assertSame( $expected, $theme_names ); 173 173 } 174 174 … … 193 193 ); 194 194 195 $this->assert Equals( $expected, get_broken_themes() );195 $this->assertSame( $expected, get_broken_themes() ); 196 196 } 197 197 … … 220 220 $theme_data = get_theme_data( DIR_TESTDATA . '/themedir1/theme1/style.css' ); 221 221 222 $this->assert Equals( 'My Theme', $theme_data['Name'] );223 $this->assert Equals( 'http://example.org/', $theme_data['URI'] );224 $this->assert Equals( 'An example theme', $theme_data['Description'] );225 $this->assert Equals( '<a href="http://example.com/">Minnie Bannister</a>', $theme_data['Author'] );226 $this->assert Equals( 'http://example.com/', $theme_data['AuthorURI'] );227 $this->assert Equals( '1.3', $theme_data['Version'] );228 $this->assert Equals( '', $theme_data['Template'] );229 $this->assert Equals( 'publish', $theme_data['Status'] );230 $this->assert Equals( array(), $theme_data['Tags'] );231 $this->assert Equals( 'My Theme', $theme_data['Title'] );232 $this->assert Equals( 'Minnie Bannister', $theme_data['AuthorName'] );222 $this->assertSame( 'My Theme', $theme_data['Name'] ); 223 $this->assertSame( 'http://example.org/', $theme_data['URI'] ); 224 $this->assertSame( 'An example theme', $theme_data['Description'] ); 225 $this->assertSame( '<a href="http://example.com/">Minnie Bannister</a>', $theme_data['Author'] ); 226 $this->assertSame( 'http://example.com/', $theme_data['AuthorURI'] ); 227 $this->assertSame( '1.3', $theme_data['Version'] ); 228 $this->assertSame( '', $theme_data['Template'] ); 229 $this->assertSame( 'publish', $theme_data['Status'] ); 230 $this->assertSame( array(), $theme_data['Tags'] ); 231 $this->assertSame( 'My Theme', $theme_data['Title'] ); 232 $this->assertSame( 'Minnie Bannister', $theme_data['AuthorName'] ); 233 233 } 234 234 … … 239 239 $theme_data = get_theme_data( $this->theme_root . '/subdir/theme2/style.css' ); 240 240 241 $this->assert Equals( 'My Subdir Theme', $theme_data['Name'] );242 $this->assert Equals( 'http://example.org/', $theme_data['URI'] );243 $this->assert Equals( 'An example theme in a sub directory', $theme_data['Description'] );244 $this->assert Equals( '<a href="http://wordpress.org/">Mr. WordPress</a>', $theme_data['Author'] );245 $this->assert Equals( 'http://wordpress.org/', $theme_data['AuthorURI'] );246 $this->assert Equals( '0.1', $theme_data['Version'] );247 $this->assert Equals( '', $theme_data['Template'] );248 $this->assert Equals( 'publish', $theme_data['Status'] );249 $this->assert Equals( array(), $theme_data['Tags'] );250 $this->assert Equals( 'My Subdir Theme', $theme_data['Title'] );251 $this->assert Equals( 'Mr. WordPress', $theme_data['AuthorName'] );241 $this->assertSame( 'My Subdir Theme', $theme_data['Name'] ); 242 $this->assertSame( 'http://example.org/', $theme_data['URI'] ); 243 $this->assertSame( 'An example theme in a sub directory', $theme_data['Description'] ); 244 $this->assertSame( '<a href="http://wordpress.org/">Mr. WordPress</a>', $theme_data['Author'] ); 245 $this->assertSame( 'http://wordpress.org/', $theme_data['AuthorURI'] ); 246 $this->assertSame( '0.1', $theme_data['Version'] ); 247 $this->assertSame( '', $theme_data['Template'] ); 248 $this->assertSame( 'publish', $theme_data['Status'] ); 249 $this->assertSame( array(), $theme_data['Tags'] ); 250 $this->assertSame( 'My Subdir Theme', $theme_data['Title'] ); 251 $this->assertSame( 'Mr. WordPress', $theme_data['AuthorName'] ); 252 252 } 253 253
Note: See TracChangeset
for help on using the changeset viewer.