Changeset 30209 for trunk/tests/phpunit/tests/taxonomy.php
- Timestamp:
- 11/03/2014 06:48:42 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/taxonomy.php
r30141 r30209 50 50 } 51 51 52 /** 53 * @group 27238 54 */ 55 public function test_get_the_taxonomies_term_template() { 56 $post_id = $this->factory->post->create(); 57 58 $taxes = get_the_taxonomies( $post_id, array( 'term_template' => '%2$s' ) ); 59 $this->assertEquals( 'Categories: Uncategorized.', $taxes['category'] ); 60 61 $taxes = get_the_taxonomies( $post_id, array( 'term_template' => '<span class="foo"><a href="%1$s">%2$s</a></span>' ) ); 62 $link = get_category_link( 1 ); 63 $this->assertEquals( 'Categories: <span class="foo"><a href="' . $link . '">Uncategorized</a></span>.', $taxes['category'] ); 64 } 65 52 66 function test_the_taxonomies() { 53 67 $post_id = $this->factory->post->create(); … … 58 72 59 73 $link = get_category_link( 1 ); 60 $expected = "Categories: <a href='$link'>Uncategorized</a>.";74 $expected = 'Categories: <a href="' . $link . '">Uncategorized</a>.'; 61 75 $this->assertEquals( $expected, $output ); 76 } 77 78 /** 79 * @group 27238 80 */ 81 function test_the_taxonomies_term_template() { 82 $post_id = $this->factory->post->create(); 83 84 $output = get_echo( 'the_taxonomies', array( array( 'post' => $post_id, 'term_template' => '%2$s' ) ) ); 85 $this->assertEquals( 'Categories: Uncategorized.', $output ); 86 87 $output = get_echo( 'the_taxonomies', array( array( 'post' => $post_id, 'term_template' => '<span class="foo"><a href="%1$s">%2$s</a></span>' ) ) ); 88 $link = get_category_link( 1 ); 89 $this->assertEquals( 'Categories: <span class="foo"><a href="' . $link . '">Uncategorized</a></span>.', $output ); 62 90 } 63 91
Note: See TracChangeset
for help on using the changeset viewer.