Changeset 35988
- Timestamp:
- 12/17/2015 05:11:07 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/term/wpGenerateTagCloud.php
r35984 r35988 79 79 'hide_empty' => false, 80 80 ) ); 81 $expected = "<a href='http://" . WP_TESTS_DOMAIN . "/?tag={$term->slug}' class='tag-link-0 tag-link-position-1' title='0 topics' style='font-size: 8pt;'>{$term->name}</a>"; 82 $this->assertEquals( $expected, wp_generate_tag_cloud( $tags, array( 83 'hide_empty' => false, 84 ) ) ); 81 82 $found = wp_generate_tag_cloud( $tags, array( 83 'hide_empty' => false, 84 ) ); 85 86 $this->assertContains( '>' . $tags[0]->name . '<', $found ); 85 87 } 86 88 … … 95 97 ) ); 96 98 97 $expected = "<a href='http://" . WP_TESTS_DOMAIN . "/?tag={$term->slug}' class='tag-link-0 tag-link-position-1' title='0 topics' style='font-size: 8pt;'>{$term->name}</a>"; 98 $this->assertEquals( $expected, wp_generate_tag_cloud( $tags, array( 99 'hide_empty' => false, 100 ) ) ); 99 $found = wp_generate_tag_cloud( $tags, array( 100 'hide_empty' => false, 101 'format' => 'array', 102 ) ); 103 104 $this->assertInternalType( 'array', $found ); 105 $this->assertContains( '>' . $tags[0]->name . '<', $found[0] ); 101 106 } 102 107 … … 110 115 ) ); 111 116 112 $expected = "<ul class='wp-tag-cloud'>\n\t<li><a href='http://" . WP_TESTS_DOMAIN . "/?tag={$term->slug}' class='tag-link-0 tag-link-position-1' title='0 topics' style='font-size: 8pt;'>{$term->name}</a></li>\n</ul>\n"; 113 $this->assertEquals( $expected, wp_generate_tag_cloud( $tags, array( 117 $found = wp_generate_tag_cloud( $tags, array( 114 118 'hide_empty' => false, 115 119 'format' => 'list', 116 ) ) ); 120 ) ); 121 122 $this->assertRegExp( "|^<ul class='wp-tag-cloud'>|", $found ); 123 $this->assertRegExp( "|</ul>\n|", $found ); 124 $this->assertContains( '>' . $tags[0]->name . '<', $found ); 117 125 } 118 126 … … 130 138 ) ); 131 139 132 $ expected = "<a href='http://" . WP_TESTS_DOMAIN . "/?tag={$terms[0]->slug}' class='tag-link-0 tag-link-position-1' title='0 topics' style='font-size: 8pt;'>{$terms[0]->name}</a>\n".133 "<a href='http://" . WP_TESTS_DOMAIN . "/?tag={$terms[1]->slug}' class='tag-link-1 tag-link-position-2' title='0 topics' style='font-size: 8pt;'>{$terms[1]->name}</a>\n".134 "<a href='http://" . WP_TESTS_DOMAIN . "/?tag={$terms[2]->slug}' class='tag-link-2 tag-link-position-3' title='0 topics' style='font-size: 8pt;'>{$terms[2]->name}</a>\n".135 "<a href='http://" . WP_TESTS_DOMAIN . "/?tag={$terms[3]->slug}' class='tag-link-3 tag-link-position-4' title='0 topics' style='font-size: 8pt;'>{$terms[3]->name}</a>"; 136 $this->assertEquals( $expected, wp_generate_tag_cloud( $tags, array(137 'hide_empty' => false,138 ) ) );140 $found = wp_generate_tag_cloud( $tags, array( 141 'hide_empty' => false, 142 ) ); 143 144 foreach ( $tags as $tag ) { 145 $this->assertContains( '>' . $tag->name . '<', $found ); 146 } 139 147 } 140 148 … … 152 160 ) ); 153 161 154 $expected = "<ul class='wp-tag-cloud'>\n\t<li>". 155 "<a href='http://" . WP_TESTS_DOMAIN . "/?tag={$terms[0]->slug}' class='tag-link-0 tag-link-position-1' title='0 topics' style='font-size: 8pt;'>{$terms[0]->name}</a></li>\n\t<li>". 156 "<a href='http://" . WP_TESTS_DOMAIN . "/?tag={$terms[1]->slug}' class='tag-link-1 tag-link-position-2' title='0 topics' style='font-size: 8pt;'>{$terms[1]->name}</a></li>\n\t<li>". 157 "<a href='http://" . WP_TESTS_DOMAIN . "/?tag={$terms[2]->slug}' class='tag-link-2 tag-link-position-3' title='0 topics' style='font-size: 8pt;'>{$terms[2]->name}</a></li>\n\t<li>". 158 "<a href='http://" . WP_TESTS_DOMAIN . "/?tag={$terms[3]->slug}' class='tag-link-3 tag-link-position-4' title='0 topics' style='font-size: 8pt;'>{$terms[3]->name}</a>". 159 "</li>\n</ul>\n"; 160 161 $this->assertEquals( $expected, wp_generate_tag_cloud( $tags, array( 162 $found = wp_generate_tag_cloud( $tags, array( 162 163 'hide_empty' => false, 163 164 'format' => 'list', 164 ) ) ); 165 ) ); 166 167 $this->assertRegExp( "|^<ul class='wp-tag-cloud'>|", $found ); 168 $this->assertRegExp( "|</ul>\n|", $found ); 169 170 foreach ( $tags as $tag ) { 171 $this->assertContains( '>' . $tag->name . '<', $found ); 172 } 165 173 } 166 174
Note: See TracChangeset
for help on using the changeset viewer.