totalcms / slim-test
Slim Framework test helper built on top of the PHPUnit test framework (maintained fork of nekofar/slim-test)
v4.0.0
2026-07-21 19:34 UTC
Requires
- php: >=8.1
- illuminate/testing: ^11.0 || ^12.0
- phpunit/phpunit: ^11.0
- selective/test-traits: ^2.0 || ^3.0 || ^4.0
- slim/psr7: ^1.0
- slim/slim: ^4.0
Requires (Dev)
- ext-json: *
- friendsofphp/php-cs-fixer: ^3.8
- php-di/slim-bridge: ^3.0
This package is auto-updated.
Last update: 2026-07-21 19:51:54 UTC
README
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
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'); } }
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.