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);
 }
 public function addComment($body, $authorable)
 {
     return Comment::add($body, $authorable, $this);
 }
Exemple #3
0
 public function addComment($body, $commentable)
 {
     return Comment::add($body, $this, $commentable);
 }