コード例 #1
0
ファイル: PostEvent.php プロジェクト: cobase/cobase
 /**
  * @return Group
  */
 public function getGroup()
 {
     return $this->post->getGroup();
 }
コード例 #2
0
ファイル: PostTest.php プロジェクト: cobase/cobase
 /**
  * @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");
 }