Skip to content

Repository files navigation

Slim Test Helper

Packagist VersionPHP from PackagistPackagist DownloadsTests StatusCoverage StatusLicense

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.

Installation

To get started, install the package using composer:

composer require totalcms/slim-test --dev

Requires Slim Framework 4 and PHP 8.1 or newer.

Usage

useTotalCMS\Slim\Test\Traits\AppTestTrait;
usePHPUnit\Framework\TestCaseasBaseTestCase;
class TestCase extends BaseTestCase {
use AppTestTrait;
protectedfunctionsetUp(): void
{
$app = require__DIR__ . '/../config/bootstrap.php';
$this->setUpApp($app);
}
publicfunctiontestHomePage(): void
{
$this->get('/')
->assertOk()
->assertSee('Welcome');
}
}

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.


About

Slim Framework test helper for PHPUnit — hard fork maintained for Total CMS (TotalCMS\Slim namespace), published on Packagist.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages