Add test routes and controller.

This commit is contained in:
Pol Dellaiera 2021-08-10 15:31:25 +02:00 committed by Marc Ducobu
parent ac58340d60
commit 845833a211
3 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,32 @@
<?php
/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\WopiBundle\Controller;
use Chill\WopiBundle\Service\OpenStack\OpenStackClientInterface;
use Symfony\Component\HttpFoundation\Response;
final class Test
{
private OpenStackClientInterface $client;
public function __construct(OpenStackClientInterface $client)
{
$this->client = $client;
var_dump($client);
}
public function __invoke()
{
dump($this->client);
return new Response('fobar');
}
}

View File

@ -0,0 +1,17 @@
<?php
/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
use Chill\WopiBundle\Controller\Test;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
return static function (RoutingConfigurator $routes) {
$routes
->add('testtest', '/test')
->controller(Test::class);
};

View File

@ -0,0 +1,32 @@
<?php
/**
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
use ChampsLibres\WopiLib\WopiInterface;
use ChampsLibres\WopiTestBundle\Service\Wopi;
return static function (ContainerConfigurator $container) {
$services = $container->services();
$services
->defaults()
->autoconfigure(true)
->autowire(true);
$services
->load('ChampsLibres\\WopiTestBundle\\Service\\', __DIR__ . '/../../Service');
$services
->load('ChampsLibres\\WopiTestBundle\\Controller\\', __DIR__ . '/../../Controller')
->tag('controller.service_arguments');
$services
->alias(WopiInterface::class, Wopi::class);
};