Skip to content

Commit 8158bf4

Browse files
committed
remove tests
1 parent 38fecf6 commit 8158bf4

1 file changed

Lines changed: 0 additions & 47 deletions

File tree

tests/HttpTest.php

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Utopia\Http;
44

55
use PHPUnit\Framework\TestCase;
6-
use Utopia\DI\Container;
76
use Utopia\Http\Tests\UtopiaFPMRequestTest;
87
use Utopia\Validator\Text;
98
use Utopia\Http\Adapter\FPM\Request;
@@ -47,15 +46,6 @@ protected function restoreRequest(): void
4746
$_SERVER['REQUEST_URI'] = $this->uri;
4847
}
4948

50-
public function testCanInjectContainerInConstructor(): void
51-
{
52-
$container = new Container();
53-
$http = new Http(new Server(), 'Asia/Tel_Aviv', $container);
54-
55-
$this->assertSame($container, $http->getContainer());
56-
$this->assertInstanceOf(Container::class, (new Http(new Server(), 'Asia/Tel_Aviv'))->getContainer());
57-
}
58-
5949
public function testCanRegisterResourcesWithPublicApi(): void
6050
{
6151
$this->http->setResource('rand', fn () => 1234);
@@ -608,43 +598,6 @@ public function testCanRunRequest(): void
608598
$this->assertStringNotContainsString('HELLO', $result);
609599
}
610600

611-
public function testScopedResourcesUseNestedContainers(): void
612-
{
613-
$counter = 0;
614-
$http = new class (new Server(), 'Asia/Tel_Aviv') extends Http {
615-
public function defineResource(string $name, callable $callback, array $injections = [], ?Container $scope = null): void
616-
{
617-
$this->setResource($name, $callback, $injections, $scope);
618-
}
619-
620-
public function resource(string $name, Container $scope): mixed
621-
{
622-
return $this->getResource($name, $scope);
623-
}
624-
};
625-
626-
$http->defineResource('shared', function () use (&$counter) {
627-
$counter++;
628-
629-
return $counter;
630-
});
631-
632-
$requestA = new Container($http->getContainer());
633-
$requestB = new Container($http->getContainer());
634-
$executionA = new Container($requestA);
635-
636-
$http->defineResource('requestId', fn () => 'request-a', scope: $requestA);
637-
$http->defineResource('requestId', fn () => 'request-b', scope: $requestB);
638-
$http->defineResource('requestId', fn () => 'execution-a', scope: $executionA);
639-
640-
$this->assertSame(1, $http->resource('shared', $requestA));
641-
$this->assertSame(1, $http->resource('shared', $requestB));
642-
$this->assertSame('request-a', $http->resource('requestId', $requestA));
643-
$this->assertSame('request-b', $http->resource('requestId', $requestB));
644-
$this->assertSame('execution-a', $http->resource('requestId', $executionA));
645-
$this->assertSame('request-a', $http->resource('requestId', $requestA));
646-
}
647-
648601
public function testWildcardRoute(): void
649602
{
650603
$method = $_SERVER['REQUEST_METHOD'] ?? null;

0 commit comments

Comments
 (0)