Skip to content

Commit

Permalink
fix(kobo): Split Library controller and align names with tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ragusa87 committed Dec 7, 2024
1 parent d749a9a commit b3d2086
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Controller\Kobo\Api\V1;
namespace App\Controller\Kobo\Api\V1\Library;

use App\Controller\Kobo\AbstractKoboController;
use App\Entity\Book;
Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

namespace App\Tests\Controller\Kobo;
namespace App\Tests\Controller\Kobo\Api\V1;

use App\DataFixtures\KoboFixture;
use App\Entity\KoboDevice;
use App\Tests\Controller\Kobo\AbstractKoboControllerTest;

class KoboAnalyticsControllerTest extends AbstractKoboControllerTest
class AnalyticsControllerTest extends AbstractKoboControllerTest
{
public const SERIAL_NUMBER = 'N9413679432456';
public const DEVICE_ID = '2a92bba197b1e0574a3f7d29cb2b05b399ab0d197e6b1aa230bfb75a920b14e7c';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Tests\Controller\Kobo;
namespace App\Tests\Controller\Kobo\Api\V1;

use App\DataFixtures\BookFixture;
use App\DataFixtures\KoboFixture;
Expand All @@ -9,8 +9,9 @@
use App\Kobo\DownloadHelper;
use App\Kobo\Response\MetadataResponseService;
use App\Repository\BookRepository;
use App\Tests\Controller\Kobo\AbstractKoboControllerTest;

class KoboDownloadControllerTest extends AbstractKoboControllerTest
class DownloadControllerTest extends AbstractKoboControllerTest
{
public function testDownload(): void
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php

namespace App\Tests\Controller\Kobo;
namespace App\Tests\Controller\Kobo\Api\V1;

use App\DataFixtures\KoboFixture;
use App\Tests\Contraints\JSONContainKeys;
use App\Tests\Controller\Kobo\AbstractKoboControllerTest;
use Symfony\Component\BrowserKit\Response;

class KoboInitializationControllerTest extends AbstractKoboControllerTest
class InitializationControllerTest extends AbstractKoboControllerTest
{
/**
* @throws \JsonException
Expand Down Expand Up @@ -62,7 +63,7 @@ public function testInitialization(): void
self::assertResponseIsSuccessful();
self::assertResponseHasHeader('kobo-api-token');

$content = file_get_contents(__DIR__.'/KoboInitializationControllerTest.json');
$content = file_get_contents(__DIR__ . '/KoboInitializationControllerTest.json');
if ($content === false) {
self::fail('Unable to read test data');
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

namespace App\Tests\Controller\Kobo;
namespace App\Tests\Controller\Kobo\Api\V1;

use App\DataFixtures\KoboFixture;
use App\DataFixtures\ShelfFixture;
use App\Entity\Shelf;
use App\Tests\Controller\Kobo\AbstractKoboControllerTest;

class KoboTagControllerTest extends AbstractKoboControllerTest
{
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Tests\Controller\Kobo;
namespace App\Tests\Controller\Kobo\Api\V1\Library;

use App\DataFixtures\BookFixture;
use App\DataFixtures\KoboFixture;
Expand All @@ -13,12 +13,13 @@
use App\Kobo\Request\ReadingStateStatistics;
use App\Kobo\Request\ReadingStateStatusInfo;
use App\Kobo\Response\StateResponse;
use App\Tests\Controller\Kobo\AbstractKoboControllerTest;
use Symfony\Component\Serializer\SerializerInterface;

/**
* @phpstan-type ReadingStateCriteria array{'book':int, 'readPages': int|null, 'finished': boolean}
*/
class KoboStateControllerTest extends AbstractKoboControllerTest
class StateControllerTest extends AbstractKoboControllerTest
{
public function testOpen(): void
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Tests\Controller\Kobo;
namespace App\Tests\Controller\Kobo\Api\V1\Library;

use App\DataFixtures\BookFixture;
use App\DataFixtures\KoboFixture;
Expand All @@ -11,9 +11,10 @@
use App\Service\KoboSyncTokenExtractor;
use App\Tests\Contraints\AssertHasDownloadWithFormat;
use App\Tests\Contraints\JSONIsValidSyncResponse;
use App\Tests\Controller\Kobo\AbstractKoboControllerTest;
use App\Tests\TestClock;

class KoboSyncControllerTest extends AbstractKoboControllerTest
class SyncControllerTest extends AbstractKoboControllerTest
{
protected function setUp(): void
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?php

namespace App\Tests\Controller\Kobo;
namespace App\Tests\Controller\Kobo\Api\V3;

use App\Tests\Controller\Kobo\AbstractKoboControllerTest;
use Symfony\Component\HttpFoundation\Response;

class ReadServiceCheckForChangesControllerTest extends AbstractKoboControllerTest
class ContentControllerTest extends AbstractKoboControllerTest
{
public function testCheckForChangesPost(): void
{
Expand Down

0 comments on commit b3d2086

Please sign in to comment.