diff --git a/src/Bundle/ChillWopiBundle/src/Controller/Convert.php b/src/Bundle/ChillWopiBundle/src/Controller/ConvertController.php similarity index 99% rename from src/Bundle/ChillWopiBundle/src/Controller/Convert.php rename to src/Bundle/ChillWopiBundle/src/Controller/ConvertController.php index 16be18803..73207e13a 100644 --- a/src/Bundle/ChillWopiBundle/src/Controller/Convert.php +++ b/src/Bundle/ChillWopiBundle/src/Controller/ConvertController.php @@ -31,7 +31,7 @@ use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface; use Symfony\Contracts\HttpClient\HttpClientInterface; use Symfony\Contracts\HttpClient\ResponseInterface; -class Convert +class ConvertController { private const LOG_PREFIX = '[convert] '; diff --git a/src/Bundle/ChillWopiBundle/src/Resources/config/routes/routes.php b/src/Bundle/ChillWopiBundle/src/Resources/config/routes/routes.php index 2272c9efd..62837a3ce 100644 --- a/src/Bundle/ChillWopiBundle/src/Resources/config/routes/routes.php +++ b/src/Bundle/ChillWopiBundle/src/Resources/config/routes/routes.php @@ -19,5 +19,5 @@ return static function (RoutingConfigurator $routes) { $routes ->add('chill_wopi_object_convert', '/convert/{uuid}') - ->controller(Chill\WopiBundle\Controller\Convert::class); + ->controller(Chill\WopiBundle\Controller\ConvertController::class); }; diff --git a/src/Bundle/ChillWopiBundle/tests/Controller/ConvertTest.php b/src/Bundle/ChillWopiBundle/tests/Controller/ConvertControllerTest.php similarity index 86% rename from src/Bundle/ChillWopiBundle/tests/Controller/ConvertTest.php rename to src/Bundle/ChillWopiBundle/tests/Controller/ConvertControllerTest.php index 2bc3f4769..0a928bcd9 100644 --- a/src/Bundle/ChillWopiBundle/tests/Controller/ConvertTest.php +++ b/src/Bundle/ChillWopiBundle/tests/Controller/ConvertControllerTest.php @@ -14,7 +14,7 @@ namespace Chill\WopiBundle\Tests\Controller; use Chill\DocStoreBundle\Entity\StoredObject; use Chill\DocStoreBundle\Service\StoredObjectManagerInterface; use Chill\MainBundle\Entity\User; -use Chill\WopiBundle\Controller\Convert; +use Chill\WopiBundle\Controller\ConvertController; use PHPUnit\Framework\TestCase; use Prophecy\PhpUnit\ProphecyTrait; use Psr\Log\NullLogger; @@ -30,13 +30,14 @@ use Symfony\Component\Security\Core\Security; * * @coversNothing */ -final class ConvertTest extends TestCase +final class ConvertControllerTest extends TestCase { use ProphecyTrait; public function testConversionFailed(): void { - $storedObject = (new StoredObject())->setType('application/vnd.oasis.opendocument.text'); + $storedObject = new StoredObject(); + $storedObject->registerVersion(type: 'application/vnd.oasis.opendocument.text'); $httpClient = new MockHttpClient([ new MockResponse('not authorized', ['http_code' => 401]), @@ -50,7 +51,7 @@ final class ConvertTest extends TestCase $parameterBag = new ParameterBag(['wopi' => ['server' => 'http://collabora:9980']]); - $convert = new Convert( + $convert = new ConvertController( $httpClient, $this->makeRequestStack(), $security->reveal(), @@ -66,7 +67,8 @@ final class ConvertTest extends TestCase public function testEverythingWentFine(): void { - $storedObject = (new StoredObject())->setType('application/vnd.oasis.opendocument.text'); + $storedObject = new StoredObject(); + $storedObject->registerVersion(type: 'application/vnd.oasis.opendocument.text'); $httpClient = new MockHttpClient([ new MockResponse('1234', ['http_code' => 200]), @@ -80,7 +82,7 @@ final class ConvertTest extends TestCase $parameterBag = new ParameterBag(['wopi' => ['server' => 'http://collabora:9980']]); - $convert = new Convert( + $convert = new ConvertController( $httpClient, $this->makeRequestStack(), $security->reveal(),