WordPress.org

Make WordPress Core

Ticket #43804: 43804.diff

File 43804.diff, 793 bytes (added by birgire, 3 years ago)
  • tests/phpunit/tests/term/wpGetObjectTerms.php

    diff --git tests/phpunit/tests/term/wpGetObjectTerms.php tests/phpunit/tests/term/wpGetObjectTerms.php
    index e7851dc..7868ba8 100644
    class Tests_Term_WpGetObjectTerms extends WP_UnitTestCase { 
    945945
    946946                $this->assertEqualSets( $expected, $actual );
    947947        }
     948       
     949        /**
     950         * @ticket 43804
     951         */
     952        public function test_with_object_and_unassigned_hierarchical_taxonomy_terms_in_args_should_return_empty() {
     953                $p = self::factory()->post->create();
     954                $taxonomy = 'wptests_tax_unassigned';
     955                register_taxonomy( $taxonomy, 'post', array( 'hierarchical' => true ) );
     956                $found = wp_get_object_terms( $p, $taxonomy, array( 'orderby' => 'name' ) );
     957                $this->assertEmpty( $found );
     958        }
     959
    948960}