mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-04 18:48:43 +00:00
92 - Dealing with Out of Sync Mocks
This commit is contained in:
@@ -12,6 +12,12 @@ abstract class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||
*/
|
||||
protected $baseUrl = 'http://localhost';
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
Mockery::getConfiguration()->allowMockingNonExistentMethods(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the application.
|
||||
*
|
||||
|
||||
@@ -40,7 +40,7 @@ class TicketTest extends TestCase
|
||||
{
|
||||
$order = factory(Order::class)->create();
|
||||
$ticket = factory(Ticket::class)->create(['code' => null]);
|
||||
TicketCode::shouldReceive('generate')->andReturn('TICKETCODE1');
|
||||
TicketCode::shouldReceive('generateFor')->with($ticket)->andReturn('TICKETCODE1');
|
||||
|
||||
$ticket->claimFor($order);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user