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