Skip to content

Commit 96cec11

Browse files
committed
chore: fix tests
1 parent 8baa1c7 commit 96cec11

File tree

2 files changed

+47
-19
lines changed

2 files changed

+47
-19
lines changed

composer.lock

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/HttpTest.php

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -119,28 +119,14 @@ public function testCanGetResources(): void
119119

120120
public function testCanGetDefaultValueWithFunction(): void
121121
{
122-
App::setResource('first', fn ($second) => "first-{$second}", ['second']);
123-
App::setResource('second', fn () => 'second');
122+
Http::setResource('first', fn ($second) => "first-{$second}", ['second']);
123+
Http::setResource('second', fn () => 'second');
124124

125-
$second = $this->app->getResource('second');
126-
$first = $this->app->getResource('first');
125+
$second = $this->http->getResource('second');
126+
$first = $this->http->getResource('first');
127127
$this->assertEquals('second', $second);
128128
$this->assertEquals('first-second', $first);
129129

130-
// Default Params
131-
$route = new Route('GET', '/path');
132-
133-
$route
134-
->param('x', 'x-def', new Text(200), 'x param', true)
135-
->action(function ($x) {
136-
echo $x;
137-
});
138-
139-
\ob_start();
140-
$this->app->execute($route, new Request(), new Response());
141-
$result = \ob_get_contents();
142-
\ob_end_clean();
143-
144130
// Default Value using function
145131
$route = new Route('GET', '/path');
146132

@@ -153,7 +139,7 @@ public function testCanGetDefaultValueWithFunction(): void
153139
});
154140

155141
\ob_start();
156-
$this->app->execute($route, new Request(), new Response());
142+
$this->http->execute($route, new Request(), '1');
157143
$result = \ob_get_contents();
158144
\ob_end_clean();
159145

0 commit comments

Comments
 (0)