Make WordPress Core

Changeset 432 in tests


Ignore:
Timestamp:
08/25/2011 06:48:34 PM (13 years ago)
Author:
ryan
Message:

Test for wp_get_object_terms() where fields = slugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_includes_taxonomy.php

    r407 r432  
    299299    }
    300300
     301    function test_get_object_terms_by_slug() {
     302        $this->_insert_quick_posts(1);
     303        $post_id = end($this->post_ids);
     304
     305        $terms_1 = array('Foo', 'Bar', 'Baz');
     306        $terms_1_slugs = array('foo', 'bar', 'baz');
     307
     308        // set the initial terms
     309        $tt_1 = wp_set_object_terms( $post_id, $terms_1, $this->taxonomy );
     310        $this->assertEquals( 3, count($tt_1) );
     311
     312        // make sure they're correct
     313        $terms = wp_get_object_terms($post_id, $this->taxonomy, array('fields' => 'slugs', 'orderby' => 't.term_id'));
     314        $this->assertEquals( $terms_1_slugs, $terms );
     315    }
     316
    301317    function test_set_object_terms_invalid() {
    302318        $this->_insert_quick_posts(1);
Note: See TracChangeset for help on using the changeset viewer.