diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results new file mode 100644 index 0000000..722ec3d --- /dev/null +++ b/.phpunit.cache/test-results @@ -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}} \ No newline at end of file diff --git a/tests/OneTest.php b/tests/OneTest.php index aa448a0..d3b212a 100644 --- a/tests/OneTest.php +++ b/tests/OneTest.php @@ -33,7 +33,7 @@ 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 @@ -41,13 +41,14 @@ 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']); } }