spiral/testing

Spiral Framework testing SDK

Package info

github.com/spiral/testing

Homepage

Chat

Documentation

pkg:composer/spiral/testing

Fund package maintenance!

spiral

Statistics

Installs: 1 918 174

Dependents: 59

Suggesters: 1

Stars: 7

Open Issues: 11

3.0.0 2026-05-07 15:18 UTC

Requires

Requires (Dev)

Suggests

  • ext-gd: Required to use generate fake image files
  • brianium/paratest: Required to run tests in parallel (^6.0).

Provides

None

Conflicts

None

Replaces

None

MIT fc7710bc9c2aeca5a20c77b8baff56c33960bd72

  • Anton Titov (wolfy-j) <wolfy-j.woop@spiralscout.com>
  • Pavel Buchnev (butschster) <pavel.buchnev.woop@spiralscout.com>
  • Aleksei Gagarin (roxblnfk) <alexey.gagarin.woop@spiralscout.com>
  • Maksim Smakouz (msmakouz) <maksim.smakouz.woop@spiralscout.com>
  • RoadRunner Community

testingspiralspiral-packages


README

👁 Latest Version on Packagist
👁 Total Downloads

Requirements

Make sure that your server is configured with following PHP version and extensions:

  • PHP 8.1+
  • Spiral framework 3.15+

Documentation on how to install and use the package can be found on the official documentation page - Testing — Getting Started

Spiral package testing

There are some difference between App and package testing. One of them - tou don't have application and bootloaders.

TestCase from the package has custom TestApp implementation that will help you to test your packages without creating extra classes.

The following example will show you how it is easy-peasy.

Tests folder structure:

tests
 - app
 - config
 - my-config.php
 - ...
 - src
 - TestCase.php
 - MyFirstTestCase.php

TestCase configuration

namespace MyPackage\Tests;

abstract class TestCase extends \Spiral\Testing\TestCase
{
 public function rootDirectory(): string
 {
 return __DIR__.'/../';
 }

 public function defineBootloaders(): array
 {
 return [
 \MyPackage\Bootloaders\PackageBootloader::class,
 // ...
 ];
 }
}

License

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