示例#1
0
 /**
  * Setup.
  */
 public function setUp()
 {
     $this->commentRepository = $this->getMock('Elcodi\\Component\\Comment\\Repository\\CommentRepository', [], [], '', false);
     $this->voteManager = $this->getMock('Elcodi\\Component\\Comment\\Services\\VoteManager', [], [], '', false);
     $commentVotes = $this->getMock('Elcodi\\Component\\Comment\\Entity\\VotePackage', [], [], '', false);
     $commentVotes->expects($this->any())->method('getNbVotes')->will($this->returnValue(2));
     $commentVotes->expects($this->any())->method('getNbUpVotes')->will($this->returnValue(1));
     $commentVotes->expects($this->any())->method('getNbDownVotes')->will($this->returnValue(1));
     $this->voteManager->expects($this->any())->method('getCommentVotes')->will($this->returnValue($commentVotes));
     $this->voteManager->expects($this->any())->method('create')->will($this->returnValue(new Vote()));
     $this->commentCache = new CommentCache($this->commentRepository, $this->voteManager, 'key');
     $this->commentCache->setCache($this->getMockForAbstractClass('Doctrine\\Common\\Cache\\CacheProvider'))->setEncoder($this->getMock('Elcodi\\Component\\Core\\Encoder\\Interfaces\\EncoderInterface'));
 }