Skip to content

Commit e599bab

Browse files
committed
Add checks for both 'any' keyword an array of posts
1 parent 8705f31 commit e599bab

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tests/test-timber.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,15 @@ function testGetPostByTitleAndPostType(){
110110

111111
$post_movie = Timber\Timber::get_post_by( 'title', $post_title, 'movie' );
112112
$post_page = Timber\Timber::get_post_by( 'title', $post_title, 'page' );
113-
$post_multiple = Timber\Timber::get_post_by( 'title', $post_title, 'any' );
113+
$post_multiple = Timber\Timber::get_post_by( 'title', $post_title, [ 'page', 'book' ] );
114+
$post_multiple_any = Timber\Timber::get_post_by( 'title', $post_title, 'any' );
114115

115116
$this->assertEquals( $post_id_movie, $post_movie->ID );
116117
$this->assertEquals( $post_id_page, $post_page->ID );
117118

118119
// Multiple post types should return the post with the oldest post date.
119120
$this->assertEquals( $post_id_page, $post_multiple->ID );
121+
$this->assertEquals( $post_id_page, $post_multiple_any->ID );
120122
}
121123

122124
function testGetPostByTitleForNonexistentPost(){

0 commit comments

Comments
 (0)