Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":2,"defects":[],"times":{"Tests\\Api\\OneTest::testConfigs":6.205,"Tests\\Api\\OneTest::testIndex":0.195,"Tests\\Api\\OneTest::testAbout":0.04,"Tests\\Api\\OneTest::testNotFound":0.038}}
7 changes: 4 additions & 3 deletions tests/OneTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,22 @@ public function testIndex() : void
$response = $this->runApi($this->baseUrl);
self::assertSame(200, $response['code']);
self::assertStringContainsString('API is running', $response['body']);
self::assertSame('api.index', App::router()->getMatchedRoute()->getName());
self::assertSame('api.home.index', App::router()->getMatchedRoute()->getName());
}

public function testAbout() : void
{
$response = $this->runApi($this->baseUrl . 'about');
self::assertSame(200, $response['code']);
self::assertStringContainsString('API project powered by Webisters framework', $response['body']);
self::assertSame('api.about', App::router()->getMatchedRoute()->getName());
self::assertSame('api.home.about', App::router()->getMatchedRoute()->getName());
}

public function testNotFound() : void
{
$response = $this->runApi($this->baseUrl . 'wakawaka');
self::assertSame(404, $response['code']);
self::assertStringContainsString('Route not found', $response['body']);
self::assertStringContainsString('"message": "Not Found"', $response['body']);
self::assertStringContainsString('"path": "/wakawaka"', $response['body']);
}
}
Loading