Is there an award for this?

This commit is contained in:
2025-05-12 14:35:00 -04:00
parent b9f4b4500d
commit 7f7af2f3b4
14 changed files with 622 additions and 33 deletions

View File

@@ -0,0 +1,75 @@
<?php
declare(strict_types=1);
namespace Siteworxpro\Tests\Controllers;
use League\Route\Http\Exception\NotFoundException;
use Nyholm\Psr7\ServerRequest;
use PHPUnit\Framework\MockObject\Exception;
use Psr\Log\LoggerInterface;
use Siteworxpro\App\Controllers\Controller;
use Siteworxpro\App\Facades\Logger;
use Siteworxpro\App\Traefik\ProtocolEnum;
use Siteworxpro\Tests\Unit;
class ControllerTest extends Unit
{
/**
* @throws NotFoundException
*/
public function testGet(): void
{
$fooController = new FooController();
$request = new ServerRequest('GET', '/foo');
$this->expectException(NotFoundException::class);
$fooController->get($request);
}
/**
* @throws NotFoundException
*/
public function testPost(): void
{
$fooController = new FooController();
$request = new ServerRequest('GET', '/foo');
$this->expectException(NotFoundException::class);
$fooController->post($request);
}
/**
* @throws NotFoundException
*/
public function testDelete(): void
{
$fooController = new FooController();
$request = new ServerRequest('GET', '/foo');
$this->expectException(NotFoundException::class);
$fooController->delete($request);
}
/**
* @throws NotFoundException
*/
public function testPatch(): void
{
$fooController = new FooController();
$request = new ServerRequest('GET', '/foo');
$this->expectException(NotFoundException::class);
$fooController->patch($request);
}
}
class FooController extends Controller
{
}