mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +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\HttpClientInterface;
|
||||||
use Symfony\Contracts\HttpClient\ResponseInterface;
|
use Symfony\Contracts\HttpClient\ResponseInterface;
|
||||||
|
|
||||||
class Convert
|
class ConvertController
|
||||||
{
|
{
|
||||||
private const LOG_PREFIX = '[convert] ';
|
private const LOG_PREFIX = '[convert] ';
|
||||||
|
|
@ -19,5 +19,5 @@ return static function (RoutingConfigurator $routes) {
|
|||||||
|
|
||||||
$routes
|
$routes
|
||||||
->add('chill_wopi_object_convert', '/convert/{uuid}')
|
->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\Entity\StoredObject;
|
||||||
use Chill\DocStoreBundle\Service\StoredObjectManagerInterface;
|
use Chill\DocStoreBundle\Service\StoredObjectManagerInterface;
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\WopiBundle\Controller\Convert;
|
use Chill\WopiBundle\Controller\ConvertController;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
use Prophecy\PhpUnit\ProphecyTrait;
|
use Prophecy\PhpUnit\ProphecyTrait;
|
||||||
use Psr\Log\NullLogger;
|
use Psr\Log\NullLogger;
|
||||||
@ -30,13 +30,14 @@ use Symfony\Component\Security\Core\Security;
|
|||||||
*
|
*
|
||||||
* @coversNothing
|
* @coversNothing
|
||||||
*/
|
*/
|
||||||
final class ConvertTest extends TestCase
|
final class ConvertControllerTest extends TestCase
|
||||||
{
|
{
|
||||||
use ProphecyTrait;
|
use ProphecyTrait;
|
||||||
|
|
||||||
public function testConversionFailed(): void
|
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([
|
$httpClient = new MockHttpClient([
|
||||||
new MockResponse('not authorized', ['http_code' => 401]),
|
new MockResponse('not authorized', ['http_code' => 401]),
|
||||||
@ -50,7 +51,7 @@ final class ConvertTest extends TestCase
|
|||||||
|
|
||||||
$parameterBag = new ParameterBag(['wopi' => ['server' => 'http://collabora:9980']]);
|
$parameterBag = new ParameterBag(['wopi' => ['server' => 'http://collabora:9980']]);
|
||||||
|
|
||||||
$convert = new Convert(
|
$convert = new ConvertController(
|
||||||
$httpClient,
|
$httpClient,
|
||||||
$this->makeRequestStack(),
|
$this->makeRequestStack(),
|
||||||
$security->reveal(),
|
$security->reveal(),
|
||||||
@ -66,7 +67,8 @@ final class ConvertTest extends TestCase
|
|||||||
|
|
||||||
public function testEverythingWentFine(): void
|
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([
|
$httpClient = new MockHttpClient([
|
||||||
new MockResponse('1234', ['http_code' => 200]),
|
new MockResponse('1234', ['http_code' => 200]),
|
||||||
@ -80,7 +82,7 @@ final class ConvertTest extends TestCase
|
|||||||
|
|
||||||
$parameterBag = new ParameterBag(['wopi' => ['server' => 'http://collabora:9980']]);
|
$parameterBag = new ParameterBag(['wopi' => ['server' => 'http://collabora:9980']]);
|
||||||
|
|
||||||
$convert = new Convert(
|
$convert = new ConvertController(
|
||||||
$httpClient,
|
$httpClient,
|
||||||
$this->makeRequestStack(),
|
$this->makeRequestStack(),
|
||||||
$security->reveal(),
|
$security->reveal(),
|
Loading…
x
Reference in New Issue
Block a user