Skip to content

Commit

Permalink
Update test with new doc root syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderdlm committed Nov 23, 2023
1 parent dc8583f commit e1d45bb
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tests/MonoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@

class MonoTest extends TestCase
{
protected function setUp(): void
{
$_SERVER['DOCUMENT_ROOT'] = __DIR__;
}

public function testRouting(): void
{
$_SERVER['REQUEST_METHOD'] = 'GET';
$_SERVER['REQUEST_URI'] = '/';

$mono = new Mono();
$mono = new Mono(__DIR__);

$mono->addRoute('GET', '/', function () {
return 'Hello, world!';
Expand All @@ -34,7 +29,7 @@ public function testTwigRendering(): void
$_SERVER['REQUEST_METHOD'] = 'GET';
$_SERVER['REQUEST_URI'] = '/';

$mono = new Mono();
$mono = new Mono(__DIR__);

$mono->addRoute('GET', '/', function () use ($mono) {
return $mono->render('index.html.twig', [
Expand All @@ -52,7 +47,7 @@ public function testDependencyInjection(): void
$_SERVER['REQUEST_METHOD'] = 'GET';
$_SERVER['REQUEST_URI'] = '/';

$mono = new Mono();
$mono = new Mono(__DIR__);

$mono->addRoute('GET', '/', function () use ($mono) {
$demoClass = $mono->get(NodeTraverser::class);
Expand Down

0 comments on commit e1d45bb

Please sign in to comment.