metabox = new Metabox('Test Metabox'); $this->field = new MetaboxField('Test Field'); } /** * @test */ public function hasGroupKeyOnInstantiation() { $this->assertEquals('group_test_metabox', $this->metabox->key); } /** * @test */ public function assignsPostTypeOnce() { $this->metabox->posttype(['post', 'page']); $expectedPostTypes = [ 'post' => 'post', 'page' => 'page', ]; $this->assertEquals($expectedPostTypes, $this->metabox->posttypes); $this->metabox->posttype('post'); $this->assertEquals($expectedPostTypes, $this->metabox->posttypes); } /** * @test */ public function modifiesAndHoldsPassedField() { $this->metabox->field($this->field); $this->assertEquals($this->field->parent, $this->metabox->key); $this->assertEquals($this->metabox->fields[$this->field->key], $this->field); } }