Pruebas y chequeos

This commit is contained in:
Juan Pablo Vial
2025-08-29 18:33:30 -04:00
parent eeee12e6e9
commit c220e7438b
5 changed files with 57 additions and 6 deletions

View File

@ -58,6 +58,11 @@ class ReservationTest extends TestCase
->disableOriginalConstructor()->getMock();
$this->promotionService = $this->getMockBuilder(Service\Venta\Promotion::class)
->disableOriginalConstructor()->getMock();
$this->promotionService->method('getById')->willReturnCallback(function($id) {
$promotion = new Model\Venta\Promotion();
$promotion->id = $id;
return $promotion;
});
$this->unitService = $this->getMockBuilder(Service\Venta\Unidad::class)
->disableOriginalConstructor()->getMock();
$this->unitService->method('getById')->willReturnCallback(function($id) {
@ -84,7 +89,7 @@ class ReservationTest extends TestCase
$digit = $faker->boolean(100-round(1/11*100)) ? $faker->randomNumber(1) : 'K';
$broker = $faker->boolean(10) ? $faker->randomNumber(8, true) : '';
$promotions = [];
$promotionsCount = $faker->numberBetween(0, 10);
$promotionsCount = $faker->numberBetween(0, 3);
for ($i = 0; $i < $promotionsCount; $i++) {
$promotions[] = $faker->numberBetween(1, 100);
}