Skip to content

Commit 7358230

Browse files
committed
4992: Fixed test issue
1 parent 1e34cf2 commit 7358230

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/InteractiveSlide/InstantBook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ private function getBusyIntervals(string $token, array $resources, \DateTime $st
444444
return $result;
445445
}
446446

447-
private function intervalFree(array $schedule, \DateTime $from, \DateTime $to): bool
447+
public function intervalFree(array $schedule, \DateTime $from, \DateTime $to): bool
448448
{
449449
foreach ($schedule as $scheduleEntry) {
450450
if (!($scheduleEntry['startTime'] > $to || $scheduleEntry['endTime'] < $from)) {

tests/Service/InteractiveServiceTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
namespace App\Tests\Service;
66

77
use App\Entity\Tenant\Slide;
8-
use App\Exceptions\InteractiveSlideException;
8+
use App\Exceptions\BadRequestException;
9+
use App\Exceptions\NotAcceptableException;
910
use App\InteractiveSlide\InstantBook;
1011
use App\InteractiveSlide\InteractionSlideRequest;
1112
use App\Repository\UserRepository;
@@ -41,7 +42,7 @@ public function testParseRequestBody(): void
4142
{
4243
$interactiveService = $this->container->get(InteractiveSlideService::class);
4344

44-
$this->expectException(InteractiveSlideException::class);
45+
$this->expectException(BadRequestException::class);
4546

4647
$interactiveService->parseRequestBody([
4748
'test' => 'test',
@@ -73,19 +74,19 @@ public function testPerformAction(): void
7374
'data' => [],
7475
]);
7576

76-
$this->expectException(InteractiveSlideException::class);
77-
$this->expectExceptionMessage('Interactive slide not found');
77+
$this->expectException(NotAcceptableException::class);
78+
$this->expectExceptionMessage('Interactive slide config not found');
7879

7980
$tenant = $user->getActiveTenant();
8081

81-
$interactiveService->performAction($user, $slide, $interactionRequest);
82+
$interactiveService->performAction($tenant, $slide, $interactionRequest);
8283

8384
$interactiveService->saveConfiguration($tenant, InstantBook::class, []);
8485

85-
$this->expectException(InteractiveSlideException::class);
86+
$this->expectException(NotAcceptableException::class);
8687
$this->expectExceptionMessage('Action not allowed');
8788

88-
$interactiveService->performAction($user, $slide, $interactionRequest);
89+
$interactiveService->performAction($tenant, $slide, $interactionRequest);
8990
}
9091

9192
public function testGetConfigurables(): void

0 commit comments

Comments
 (0)