示例#1
0
 /**
  * Setup
  */
 public function setUp()
 {
     $this->commentObjectDirector = $this->getMock('Elcodi\\Component\\Core\\Services\\ObjectDirector', [], [], '', false);
     $this->commentObjectDirector->expects($this->any())->method('create')->will($this->returnValue(new Comment()));
     $this->commentManager = new CommentManager($this->getMock('Elcodi\\Component\\Comment\\EventDispatcher\\CommentEventDispatcher', [], [], '', false), $this->commentObjectDirector);
 }
示例#2
0
 /**
  * Test remove vote when no exists.
  */
 public function testRemoveNonExistingVote()
 {
     $this->voteDirector->expects($this->any())->method('findOneBy')->will($this->returnValue(null));
     $this->voteDirector->expects($this->never())->method('remove');
     $this->voteManager->removeVote($this->comment, $this->authorToken, Vote::DOWN);
 }