You've already forked Php-Template
feat: implement NotFoundResponse and ServerErrorResponse classes with corresponding tests
Some checks failed
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 4m16s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 4m17s
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 4m27s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 4m32s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 4m15s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Failing after 3m1s
Some checks failed
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Successful in 4m16s
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Successful in 4m17s
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Successful in 4m27s
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Successful in 4m32s
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Successful in 4m15s
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Failing after 3m1s
This commit is contained in:
22
tests/Http/Responses/NotFoundResponseTest.php
Normal file
22
tests/Http/Responses/NotFoundResponseTest.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Siteworxpro\Tests\Http\Responses;
|
||||
|
||||
use Siteworxpro\App\Http\Responses\NotFoundResponse;
|
||||
use Siteworxpro\Tests\Unit;
|
||||
|
||||
class NotFoundResponseTest extends Unit
|
||||
{
|
||||
public function testToArray(): void
|
||||
{
|
||||
$response = new NotFoundResponse('/api/resource', ['key' => 'value']);
|
||||
|
||||
$expected = [
|
||||
'status_code' => 404,
|
||||
'message' => 'The requested resource /api/resource was not found.',
|
||||
'context' => ['key' => 'value'],
|
||||
];
|
||||
|
||||
$this->assertEquals($expected, $response->toArray());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user