test/unit/Domain/Service/Availability/DiscountCodeAvailabilityTest.php 1 location
|
@@ 93-101 (lines=9) @@
|
| 90 |
|
* @dataProvider provideIsAvailable |
| 91 |
|
* |
| 92 |
|
*/ |
| 93 |
|
public function testIsAvailable($code, $expected) |
| 94 |
|
{ |
| 95 |
|
$mockFinder = m::mock(RepositoryInterface::class); |
| 96 |
|
$mockFinder->shouldReceive('matching')->andReturn(new ArrayCollection($this->config->getDiscountCodes())); |
| 97 |
|
|
| 98 |
|
$sut = new DiscountCodeAvailability($mockFinder, ...$this->filters); |
| 99 |
|
|
| 100 |
|
self::assertEquals($expected, $sut->isAvailable($code)); |
| 101 |
|
} |
| 102 |
|
|
| 103 |
|
public function provideIsAvailable() |
| 104 |
|
{ |
test/unit/Domain/Service/Availability/TicketAvailabilityTest.php 1 location
|
@@ 91-99 (lines=9) @@
|
| 88 |
|
* @param $quantity |
| 89 |
|
* @param $expected |
| 90 |
|
*/ |
| 91 |
|
public function testIsAvailable($ticketType, $quantity, $expected) |
| 92 |
|
{ |
| 93 |
|
$mockFinder = m::mock(RepositoryInterface::class); |
| 94 |
|
$mockFinder->shouldReceive('matching')->andReturn($this->ticketCounters); |
| 95 |
|
|
| 96 |
|
$sut = new TicketAvailability($mockFinder, ...$this->filters); |
| 97 |
|
|
| 98 |
|
self::assertEquals($expected, $sut->isAvailable($ticketType, $quantity)); |
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
public function provideIsAvailable() |
| 102 |
|
{ |