Make WordPress Core

Ticket #14156: 14156-tests.patch

File 14156-tests.patch, 1.1 KB (added by mordauk, 9 years ago)
  • tests/phpunit/tests/term.php

     
    620620        }
    621621
    622622        /**
     623         * @ticket 14156
     624         */
     625        public function test_get_term_link() {
     626
     627                $cat_id = $this->factory->category->create( array( 'name' => 'Category 1' ) );
     628                $tag_id = $this->factory->tag->create( array( 'name' => 'Tag 1' ) );
     629
     630                $link1 = get_term_link( $cat_id, 'category', 'id' );
     631                $link2 = get_term_link( 'category-1', 'category', 'slug' );
     632                $link3 = get_term_link( 'Category 1', 'category', 'name' );
     633
     634                $this->assertEquals( $link1, $link2 );
     635                $this->assertEquals( $link1, $link3 );
     636                $this->assertEquals( $link2, $link3 );
     637
     638                $link1 = get_term_link( $tag_id, 'post_tag', 'id' );
     639                $link2 = get_term_link( 'tag-1', 'post_tag', 'slug' );
     640                $link3 = get_term_link( 'Tag 1', 'post_tag', 'name' );
     641
     642                $this->assertEquals( $link1, $link2 );
     643                $this->assertEquals( $link1, $link3 );
     644                $this->assertEquals( $link2, $link3 );
     645        }
     646
     647        /**
    623648         * @ticket 19205
    624649         */
    625650        function test_orphan_category() {