You've already forked Php-Template
feat: add abstract classes for controllers, facades, and service providers with unit tests
Some checks failed
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Has started running
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Has been cancelled
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Has been cancelled
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Has been cancelled
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Has been cancelled
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Has been cancelled
Some checks failed
🧪✨ Tests Workflow / 🧪 ✨ Database Migrations (push) Has started running
🧪✨ Tests Workflow / 🧪 ✅ Unit Tests (push) Has been cancelled
🧪✨ Tests Workflow / 🛡️ 🔒 License Check (push) Has been cancelled
🧪✨ Tests Workflow / 🐙 🔍 Code Sniffer (push) Has been cancelled
🧪✨ Tests Workflow / 🛡️ 🔒 Library Audit (push) Has been cancelled
🧪✨ Tests Workflow / 📝 ✨ Code Lint (push) Has been cancelled
This commit is contained in:
56
tests/Controllers/ControllerTest.php
Normal file
56
tests/Controllers/ControllerTest.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Siteworxpro\Tests\Controllers;
|
||||
|
||||
use Siteworxpro\App\Controllers\Controller;
|
||||
|
||||
class ControllerTest extends AbstractController
|
||||
{
|
||||
public function testNotFoundExceptions()
|
||||
{
|
||||
$testClass = new TestClass();
|
||||
|
||||
$this->expectException(\League\Route\Http\Exception\NotFoundException::class);
|
||||
$testClass->get($this->getMockRequest());
|
||||
}
|
||||
|
||||
public function testNotFoundExceptionPost()
|
||||
{
|
||||
$testClass = new TestClass();
|
||||
|
||||
$this->expectException(\League\Route\Http\Exception\NotFoundException::class);
|
||||
$testClass->post($this->getMockRequest());
|
||||
}
|
||||
|
||||
public function testNotFoundExceptionPut()
|
||||
{
|
||||
$testClass = new TestClass();
|
||||
|
||||
$this->expectException(\League\Route\Http\Exception\NotFoundException::class);
|
||||
$testClass->put($this->getMockRequest());
|
||||
}
|
||||
|
||||
public function testNotFoundExceptionDelete()
|
||||
{
|
||||
$testClass = new TestClass();
|
||||
|
||||
$this->expectException(\League\Route\Http\Exception\NotFoundException::class);
|
||||
$testClass->delete($this->getMockRequest());
|
||||
}
|
||||
|
||||
public function testNotFoundExceptionPatch()
|
||||
{
|
||||
$testClass = new TestClass();
|
||||
|
||||
$this->expectException(\League\Route\Http\Exception\NotFoundException::class);
|
||||
$testClass->patch($this->getMockRequest());
|
||||
}
|
||||
}
|
||||
|
||||
// @ignore
|
||||
class TestClass extends Controller
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user