Skip to content

Commit

Permalink
Add tests for canServe method
Browse files Browse the repository at this point in the history
  • Loading branch information
msmakouz committed Mar 1, 2024
1 parent 8ea5fa4 commit 89af47d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/src/DispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Mockery as m;
use Spiral\Attributes\AttributeReader;
use Spiral\RoadRunnerBridge\RoadRunnerMode;
use Spiral\TemporalBridge\Config\TemporalConfig;
use Spiral\TemporalBridge\DeclarationLocatorInterface;
use Spiral\TemporalBridge\DeclarationWorkerResolver;
Expand Down Expand Up @@ -39,6 +40,18 @@ protected function setUp(): void
);
}

public function testCanServe(): void
{
$this->assertTrue(Dispatcher::canServe(RoadRunnerMode::Temporal));

$this->assertFalse(Dispatcher::canServe(RoadRunnerMode::Http));
$this->assertFalse(Dispatcher::canServe(RoadRunnerMode::Jobs));
$this->assertFalse(Dispatcher::canServe(RoadRunnerMode::Grpc));
$this->assertFalse(Dispatcher::canServe(RoadRunnerMode::Tcp));
$this->assertFalse(Dispatcher::canServe(RoadRunnerMode::Centrifuge));
$this->assertFalse(Dispatcher::canServe(RoadRunnerMode::Unknown));
}

public function testServeWithoutDeclarations(): void
{
$locator = $this->mockContainer(DeclarationLocatorInterface::class);
Expand Down

0 comments on commit 89af47d

Please sign in to comment.