Skip to content

Commit 29b7021

Browse files
committed
Fix incompatibilities with framework package
1 parent effc5ba commit 29b7021

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

composer.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,12 @@
1313
"name": "kpicaza"
1414
}
1515
],
16-
"repositories": [
17-
{
18-
"type": "git",
19-
"url": "https://github.com/kpicaza/antidot-framework"
20-
}
21-
],
2216
"require": {
2317
"php": ">=8.1",
2418
"antidot-fw/framework": "3.x.x-dev",
2519
"nyholm/psr7": "^1.4",
2620
"nyholm/psr7-server": "^1.0",
21+
"psr/http-server-middleware": "^1.0",
2722
"react/http": "^1.5",
2823
"symfony/runtime": "^5.3"
2924
},

src/SyncRunner.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Laminas\HttpHandlerRunner\Emitter\SapiEmitter;
99
use Nyholm\Psr7\Factory\Psr17Factory;
1010
use Nyholm\Psr7Server\ServerRequestCreator;
11+
use React\EventLoop\Loop;
1112

1213
final class SyncRunner
1314
{
@@ -34,6 +35,9 @@ public function run(): int
3435
$this->application->handle($this->responseFactory->fromGlobals())
3536
);
3637

38+
$loop = Loop::get();
39+
$loop->run();
40+
3741
return 0;
3842
}
3943
}

test/SyncRunnerTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,20 @@
1111
use Antidot\Runtime\SyncRunner;
1212
use Laminas\HttpHandlerRunner\Emitter\SapiEmitter;
1313
use PHPUnit\Framework\TestCase;
14+
use Psr\Container\ContainerInterface;
1415
use Psr\Http\Message\ResponseInterface;
16+
use Psr\Http\Server\MiddlewareInterface;
1517

1618
final class SyncRunnerTest extends TestCase
1719
{
1820
public function testItShouldEmitApplicationResponse(): void
1921
{
20-
$middlewareFactory = $this->createMock(MiddlewareFactory::class);
22+
$container = $this->createMock(ContainerInterface::class);
23+
$container->expects(self::once())
24+
->method('get')
25+
->with('test_middleware')
26+
->willReturn($this->createMock(MiddlewareInterface::class));
27+
$middlewareFactory = new MiddlewareFactory($container);
2128
$sapi = $this->createMock(SapiEmitter::class);
2229
$sapi->expects(self::once())
2330
->method('emit')

0 commit comments

Comments
 (0)