public function testCreateInvalid() { $this->validator->expects($this->once())->method('validate')->will($this->returnValue(false)); $creator = new DefaultVoteCreator($this->voteManager, $this->voteBlamer, $this->validator); $result = $creator->create($this->vote, $this->comment); $this->assertFalse($result); }
public function testCreate() { $this->voteBlamer->expects($this->once())->method('blame')->with($this->vote); $this->validator->expects($this->once())->method('validate')->will($this->returnValue(array())); $this->voteManager->expects($this->once())->method('addVote')->with($this->vote, $this->comment); $creator = new DefaultVoteCreator($this->voteManager, $this->voteBlamer, $this->validator); $result = $creator->create($this->vote, $this->comment); $this->assertTrue($result); }