mirror of
https://github.com/flarum/framework.git
synced 2025-02-06 06:56:14 +08:00
Integration tests: Allow registering extenders
This commit is contained in:
parent
d0aa0b7920
commit
b2c3392a83
|
@ -10,6 +10,7 @@
|
|||
namespace Flarum\Tests\integration;
|
||||
|
||||
use Dflydev\FigCookies\SetCookie;
|
||||
use Flarum\Extend\ExtenderInterface;
|
||||
use Flarum\Foundation\InstalledSite;
|
||||
use Illuminate\Database\ConnectionInterface;
|
||||
use Laminas\Diactoros\CallbackStream;
|
||||
|
@ -41,13 +42,24 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase
|
|||
include __DIR__.'/tmp/config.php'
|
||||
);
|
||||
|
||||
$site->extendWith($this->extenders);
|
||||
|
||||
$this->app = $site->bootApp();
|
||||
$this->server = $this->app->getRequestHandler();
|
||||
}
|
||||
|
||||
return $this->app;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var ExtenderInterface[]
|
||||
*/
|
||||
protected $extenders = [];
|
||||
|
||||
protected function extend(ExtenderInterface $extender)
|
||||
{
|
||||
$this->extenders[] = $extender;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var RequestHandlerInterface
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user