/** * Test that we can add remove a group from the association * * @since 1.1.0 * * @group group * @group objects * @group posts_object * * @covers \ingot\testing\object\posts::remove() */ public function testRemove() { $groups = [5, 3, 7]; $obj = new \ingot\testing\object\posts($this->the_post); $obj->add($groups); $obj->remove(5); $expected = [3, 7]; $this->assertEquals(array_values($expected), array_values($obj->get_groups())); $this->assertEquals(array_values($obj->get_groups()), array_values(get_post_meta($this->the_post->ID, \ingot\testing\utility\posts::meta_key(), false))); $obj = new \ingot\testing\object\posts($this->the_post); $this->assertEquals(array_values($expected), array_values($obj->get_groups())); }