- Timestamp:
- 11/23/2016 09:52:27 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/theme/getThemeStarterContent.php
r39276 r39346 42 42 'sidebar-1' => array( 43 43 'text_business_info', 44 'text_about', 44 'text_about' => array( 45 'title' => 'Our Story', 46 ), 45 47 'archives', 46 48 'calendar', … … 64 66 'page_blog', 65 67 'page_news', 66 'page_contact', 68 'page_contact' => array( 69 'title' => 'Email Us', 70 ), 67 71 'link_email', 68 72 'link_facebook', … … 87 91 'about', 88 92 'contact', 89 'blog', 93 'blog' => array( 94 'template' => 'blog.php', 95 'post_excerpt' => 'Extended', 96 ), 90 97 'news', 91 98 'homepage-section', … … 94 101 'post_type' => 'post', 95 102 'post_title' => 'Custom', 103 'thumbnail' => '{{featured-image-logo}}', 104 ), 105 ), 106 'attachments' => array( 107 'featured-image-logo' => array( 108 'post_title' => 'Title', 109 'post_content' => 'Description', 110 'post_excerpt' => 'Caption', 111 'file' => DIR_TESTDATA . '/images/waffles.jpg', 112 ), 113 'featured-image-skipped' => array( 114 'post_title' => 'Skipped', 96 115 ), 97 116 ), … … 116 135 $this->assertCount( 16, $hydrated_starter_content['nav_menus']['top']['items'], 'Unknown should be dropped, custom should be present.' ); 117 136 $this->assertCount( 10, $hydrated_starter_content['widgets']['sidebar-1'], 'Unknown should be dropped.' ); 137 $this->assertCount( 1, $hydrated_starter_content['attachments'], 'Attachment with missing file is filtered out.' ); 138 $this->assertArrayHasKey( 'featured-image-logo', $hydrated_starter_content['attachments'] ); 139 $this->assertSame( $dehydrated_starter_content['attachments']['featured-image-logo'], $hydrated_starter_content['attachments']['featured-image-logo'] ); 118 140 119 141 foreach ( $hydrated_starter_content['widgets']['sidebar-1'] as $widget ) { … … 124 146 $this->assertArrayHasKey( 'title', $widget[1] ); 125 147 } 148 $this->assertEquals( 'text', $hydrated_starter_content['widgets']['sidebar-1'][1][0], 'Core content extended' ); 149 $this->assertEquals( 'Our Story', $hydrated_starter_content['widgets']['sidebar-1'][1][1]['title'], 'Core content extended' ); 126 150 127 151 foreach ( $hydrated_starter_content['nav_menus']['top']['items'] as $nav_menu_item ) { … … 129 153 $this->assertTrue( ! empty( $nav_menu_item['object_id'] ) || ! empty( $nav_menu_item['url'] ) ); 130 154 } 155 $this->assertEquals( 'Email Us', $hydrated_starter_content['nav_menus']['top']['items'][4]['title'], 'Core content extended' ); 131 156 132 157 foreach ( $hydrated_starter_content['posts'] as $key => $post ) { … … 137 162 $this->assertArrayHasKey( 'post_title', $post ); 138 163 } 164 $this->assertEquals( 'Extended', $hydrated_starter_content['posts']['blog']['post_excerpt'], 'Core content extended' ); 165 $this->assertEquals( 'blog.php', $hydrated_starter_content['posts']['blog']['template'], 'Core content extended' ); 166 $this->assertEquals( '{{featured-image-logo}}', $hydrated_starter_content['posts']['custom']['thumbnail'], 'Core content extended' ); 139 167 } 140 168
Note: See TracChangeset
for help on using the changeset viewer.