config add to head/body

This commit is contained in:
Milos Stojanovic
2019-06-16 11:54:58 +02:00
parent da98b46f62
commit 291fa69c2b
4 changed files with 13 additions and 20 deletions

View File

@@ -15,7 +15,6 @@ use Filegator\Config\Config;
use Filegator\Container\Container;
use Filegator\Kernel\Request;
use Filegator\Kernel\Response;
use Filegator\Services\View\Adapters\Vuejs;
use Tests\FakeResponse;
use Tests\FakeStreamedResponse;
use Tests\TestCase;
@@ -39,23 +38,4 @@ class MainTest extends TestCase
$this->assertEquals($app->resolve(Request::class), $request);
$this->assertInstanceOf(Response::class, $app->resolve(Response::class));
}
public function testServices()
{
$config = [
'services' => [
'Service1' => [
'handler' => 'Filegator\Services\View\Adapters\Vuejs',
],
'Service2' => [
'handler' => 'Filegator\Services\View\Adapters\Vuejs',
],
],
];
$app = new App(new Config($config), new Request(), new FakeResponse(), new FakeStreamedResponse(), new Container());
$this->assertEquals($app->resolve('Service1'), new Vuejs(new Config($config)));
$this->assertEquals($app->resolve('Service2'), new Vuejs(new Config($config)));
}
}

View File

@@ -46,6 +46,10 @@ return [
],
'Filegator\Services\View\ViewInterface' => [
'handler' => '\Filegator\Services\View\Adapters\Vuejs',
'config' => [
'add_to_head' => '',
'add_to_body' => '',
],
],
'Filegator\Services\Storage\Filesystem' => [
'handler' => '\Filegator\Services\Storage\Filesystem',