コード例 #1
0
ファイル: CommentTest.php プロジェクト: petersuhm/commentable
 public function testStaticAdd()
 {
     $body = 'Testkommentar';
     $authorable = new Petersuhm\Commentable\Authorable();
     $commentable = new Petersuhm\Commentable\Commentable();
     $authorable->id = 10;
     $commentable->id = 20;
     $comment = Comment::add($body, $authorable, $commentable);
     $this->assertEquals('Testkommentar', $comment->body);
     $this->assertEquals(10, $comment->authorable_id);
     $this->assertEquals('Petersuhm\\Commentable\\Authorable', $comment->authorable_type);
     $this->assertEquals(20, $comment->commentable_id);
     $this->assertEquals('Petersuhm\\Commentable\\Commentable', $comment->commentable_type);
 }
コード例 #2
0
ファイル: Commentable.php プロジェクト: petersuhm/commentable
 public function addComment($body, $authorable)
 {
     return Comment::add($body, $authorable, $this);
 }
コード例 #3
0
ファイル: Authorable.php プロジェクト: petersuhm/commentable
 public function addComment($body, $commentable)
 {
     return Comment::add($body, $this, $commentable);
 }