Esempio n. 1
0
 /**
  * @expectedException \Trismegiste\SocialBundle\Ticket\InvalidTicketException
  * @expectedExceptionMessage currently a valid ticket
  */
 public function testNoAddingTicketOnAlreadyValid()
 {
     $ticket = $this->getMock('Trismegiste\\SocialBundle\\Ticket\\EntranceAccess');
     $ticket->expects($this->exactly(3))->method('isValid')->willReturn(true);
     $this->sut->addTicket($ticket);
     $this->assertTrue($this->sut->hasValidTicket());
     $ticket = $this->getMock('Trismegiste\\SocialBundle\\Ticket\\EntranceAccess');
     $ticket->expects($this->once())->method('isValid')->willReturn(true);
     $this->sut->addTicket($ticket);
 }