mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
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:
parent
dd159f4379
commit
4d73f9b81a
@ -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] ';
|
||||
|
@ -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);
|
||||
};
|
||||
|
@ -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(),
|
Loading…
x
Reference in New Issue
Block a user