diff --git a/src/wp-includes/export/class-wp-export-query.php b/src/wp-includes/export/class-wp-export-query.php
index d0948da..30de3fe 100644
a
|
b
|
class WP_Export_Query { |
72 | 72 | |
73 | 73 | public function categories() { |
74 | 74 | if ( $this->category ) { |
75 | | return $this->category; |
| 75 | return array( $this->category ); |
76 | 76 | } |
77 | 77 | if ( $this->filters['post_type'] ) { |
78 | 78 | return array(); |
diff --git a/tests/phpunit/tests/export/class-wp-export-query.php b/tests/phpunit/tests/export/class-wp-export-query.php
index 0fd90d6..5be2567 100644
a
|
b
|
class Test_WP_Export_Query extends WP_UnitTestCase { |
174 | 174 | $category_id = $this->factory->category->create( array( 'name' => 'baba' ) ); |
175 | 175 | $other_category_id = $this->factory->category->create( array( 'name' => 'dyado' ) ); |
176 | 176 | $export = new WP_Export_Query( array( 'post_type' => 'post', 'category' => $category_id ) ); |
177 | | $this->assertEquals( 1, count( $export->categories() ) ); |
| 177 | $categories = $export->categories(); |
| 178 | $this->assertTrue( is_array( $categories ) ); |
| 179 | $this->assertEquals( 1, count( $categories ) ); |
178 | 180 | } |
179 | 181 | |
180 | 182 | function test_categories_should_return_no_categories_if_we_are_requesting_only_one_post_type() { |