Slim Framework test helper built on top of the PHPUnit test framework
Note
This is a maintained fork of nekofar/slim-test adding HEAD request support and file-upload testing, published as totalcms/slim-test.
This library inspired by the Illuminate Testing component.
To get started, install the package using composer:
composer require totalcms/slim-test --devRequires Slim Framework 4 and PHP 8.1 or newer.
use TotalCMS\Slim\Test\Traits\AppTestTrait;
use PHPUnit\Framework\TestCase as BaseTestCase;
class TestCase extends BaseTestCase
{
use AppTestTrait;
protected function setUp(): void
{
$app = require __DIR__ . '/../config/bootstrap.php';
$this->setUpApp($app);
}
public function testHomePage(): void
{
$this->get('/')
->assertOk()
->assertSee('Welcome');
}
}Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.