Rename Convert to ConvertController for clarity

Renamed Convert class and relevant references to ConvertController to improve clarity and maintain consistency. Updated corresponding test files and route configurations to reflect the new name.
This commit is contained in:
Julien Fastré 2024-09-06 14:07:51 +02:00
parent dd159f4379
commit 4d73f9b81a
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
3 changed files with 10 additions and 8 deletions

View File

@ -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] ';

View File

@ -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);
};

View File

@ -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(),