diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/MetaboxTest.php | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/tests/MetaboxTest.php b/tests/MetaboxTest.php index e26c9f2..319e4c0 100644 --- a/tests/MetaboxTest.php +++ b/tests/MetaboxTest.php @@ -36,39 +36,47 @@ class MetaboxTest extends TestCase /** * @test */ - public function assignsPostTypeOnce() + public function assignsPostType() { $this->metabox->posttype(['post', 'page']); - $expectedPostTypes = [ - 'post' => 'post', - 'page' => 'page', + $expectedLocations = [ + [ + 'param' => 'post_type', + 'operator' => '==', + 'value' => 'post' + ], + [ + 'param' => 'post_type', + 'operator' => '==', + 'value' => 'page' + ], ]; - $this->assertEquals($expectedPostTypes, $this->metabox->posttypes); - - $this->metabox->posttype('post'); - - $this->assertEquals($expectedPostTypes, $this->metabox->posttypes); + $this->assertEquals($expectedLocations, $this->metabox->locations); } /** * @test */ - public function assignsTaxonomyOnce() + public function assignsTaxonomy() { $this->metabox->taxonomy(['category', 'post_tag']); - $expectedTaxonomies = [ - 'category' => 'category', - 'post_tag' => 'post_tag', + $expectedLocations = [ + [ + 'param' => 'taxonomy', + 'operator' => '==', + 'value' => 'category' + ], + [ + 'param' => 'taxonomy', + 'operator' => '==', + 'value' => 'post_tag' + ], ]; - $this->assertEquals($expectedTaxonomies, $this->metabox->taxonomies); - - $this->metabox->taxonomy('category'); - - $this->assertEquals($expectedTaxonomies, $this->metabox->taxonomies); + $this->assertEquals($expectedLocations, $this->metabox->locations); } /** |