/** * @return Group */ public function getGroup() { return $this->post->getGroup(); }
/** * @test * * @group entity * @group post-entity */ public function testSettingGroupToAPost() { $post = new Post(); $this->assertEquals(sizeof($post->getGroup()), 0, "Initially there are no group in post"); $group = new Group(); $group->setTitle("This is a test group"); $post->setGroup($group); $this->assertEquals($post->getGroup()->getTitle(), "This is a test group"); $this->assertEquals(sizeof($post->getGroup()), 1, "There should be one group in a post"); }