You've already forked Traefik-Redis-Api
Is there an award for this?
This commit is contained in:
75
tests/Controllers/ControllerTest.php
Normal file
75
tests/Controllers/ControllerTest.php
Normal 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
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user