Integration tests: Allow registering extenders

This commit is contained in:
Franz Liedke 2020-02-07 23:29:14 +01:00
parent d0aa0b7920
commit b2c3392a83

View File

@ -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
*/