Skip to content

Commit 8a1c995

Browse files
committed
test: mirror src structure under tests/Unit and tests/Integration
- Group tests by module and area following src: App/<Modul>, Core/<Bereich>, plus Composition for cross-cutting DTO/config/enum and coverage suites. - Split CoreAndDomainTest into focused unit tests (Pagination, Account domain, EmailType, domain enums). - Fix Workspace integration tests namespace to Tests\Integration\App\Workspace.
1 parent 52274f7 commit 8a1c995

24 files changed

Lines changed: 180 additions & 140 deletions

tests/Integration/App/Workspace/Factory/CreateWorkspacesFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Envms\FluentPDO\Query;
66
use ownHackathon\App\Workspace\Infrastructure\Service\SlugService;
77
use Faker\Factory as Faker;
8-
use ownHackathon\Core\SharedKernel\Domain\Enum\Visibility;
8+
use ownHackathon\App\Policy\Domain\Enum\Visibility;
99
use Tests\Integration\App\Factory\AccountFactory;
1010

1111
class CreateWorkspacesFactory

tests/Integration/App/Workspace/ListOwnWorkspaceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace Tests\Integration\Workspace;
3+
namespace Tests\Integration\App\Workspace;
44

55
use Fig\Http\Message\StatusCodeInterface as Http;
66
use Tests\Integration\App\Workspace\Factory\CreateWorkspacesFactory;

tests/Integration/App/Workspace/WorkspaceCreateTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php declare(strict_types=1);
22

3-
namespace Tests\Integration\Workspace;
3+
namespace Tests\Integration\App\Workspace;
44

55
use ownHackathon\App\Workspace\Infrastructure\Service\SlugService;
66
use Faker\Factory as Faker;
77
use Fig\Http\Message\StatusCodeInterface as Http;
88
use PDO;
99
use Tests\Integration\JsonFactory;
10-
use ownHackathon\Core\SharedKernel\Domain\Enum\Visibility;
10+
use ownHackathon\App\Policy\Domain\Enum\Visibility;
1111

1212
use function expect;
1313

tests/Integration/App/Workspace/WorkspaceDetailTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Tests\Integration\App\Factory\AccountFactory;
99
use Tests\Integration\App\Workspace\Factory\CreateWorkspacesFactory;
1010
use Tests\Integration\JsonFactory;
11-
use ownHackathon\Core\SharedKernel\Domain\Enum\Visibility;
11+
use ownHackathon\App\Policy\Domain\Enum\Visibility;
1212

1313
use function array_keys;
1414
use function expect;

tests/Integration/Coverage/DomainAndDtoCoverageTest.php renamed to tests/Integration/Composition/DomainAndDtoCoverageTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace Tests\Integration\Coverage;
3+
namespace Tests\Integration\Composition;
44

55
use DateTimeImmutable;
66
use InvalidArgumentException;
@@ -21,7 +21,7 @@
2121
use ownHackathon\App\Token\Domain\Enum\TokenType;
2222
use ownHackathon\App\Token\Domain\Token;
2323
use ownHackathon\App\Token\Domain\TokenCollection;
24-
use ownHackathon\Core\SharedKernel\Domain\Enum\Visibility;
24+
use ownHackathon\App\Policy\Domain\Enum\Visibility;
2525
use ownHackathon\App\Workspace\Domain\Workspace;
2626
use ownHackathon\App\Workspace\Domain\WorkspaceCollection;
2727
use ownHackathon\App\Workspace\DTO\PaginationMeta;

tests/Integration/Coverage/HydratorCoverageTest.php renamed to tests/Integration/Composition/HydratorCoverageTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace Tests\Integration\Coverage;
3+
namespace Tests\Integration\Composition;
44

55
use DateTimeImmutable;
66
use ownHackathon\App\Account\Identity\Infrastructure\Hydrator\AccountAccessAuthHydrator;
@@ -9,7 +9,7 @@
99
use ownHackathon\App\Event\Infrastructure\Hydrator\EventHydrator;
1010
use ownHackathon\App\Token\Infrastructure\Hydrator\TokenHydrator;
1111
use ownHackathon\App\Workspace\Infrastructure\Hydrator\WorkspaceHydrator;
12-
use ownHackathon\Core\SharedKernel\Domain\Enum\Visibility;
12+
use ownHackathon\App\Policy\Domain\Enum\Visibility;
1313
use ownHackathon\App\Event\Domain\Enum\EventStatus;
1414
use ownHackathon\App\Token\Domain\Enum\TokenType;
1515
use ownHackathon\App\Mailing\Domain\EmailType;

tests/Integration/Coverage/RepositoryCoverageTest.php renamed to tests/Integration/Composition/RepositoryCoverageTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace Tests\Integration\Coverage;
3+
namespace Tests\Integration\Composition;
44

55
use DateTimeImmutable;
66
use Mockery;
@@ -22,7 +22,7 @@
2222
use ownHackathon\App\Token\Infrastructure\Hydrator\TokenHydratorInterface;
2323
use ownHackathon\App\Token\Infrastructure\Persistence\Repository\TokenRepository;
2424
use ownHackathon\App\Token\Infrastructure\Persistence\Table\TokenStoreInterface;
25-
use ownHackathon\Core\SharedKernel\Domain\Enum\Visibility;
25+
use ownHackathon\App\Policy\Domain\Enum\Visibility;
2626
use ownHackathon\App\Workspace\Domain\Workspace;
2727
use ownHackathon\App\Workspace\Infrastructure\Hydrator\WorkspaceHydratorInterface;
2828
use ownHackathon\App\Workspace\Infrastructure\Persistence\Repository\WorkspaceRepository;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php declare(strict_types=1);
22

3+
namespace Tests\Integration\Core\Http;
4+
35
use Fig\Http\Message\StatusCodeInterface as Http;
46
use Psr\Http\Message\ResponseInterface;
57

tests/Integration/Coverage/MiddlewareCoverageTest.php renamed to tests/Integration/Core/Persistence/FluentTransactionMiddlewareTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace Tests\Integration\Coverage;
3+
namespace Tests\Integration\Core\Persistence;
44

55
use Envms\FluentPDO\Query;
66
use Laminas\Diactoros\ServerRequestFactory;

tests/Unit/AccountServicesTest.php renamed to tests/Unit/App/Account/AccountServicesTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace Tests\Unit;
3+
namespace Tests\Unit\App\Account;
44

55
use DateTimeImmutable;
66
use ownHackathon\App\Account\Identity\Domain\Account;
@@ -69,11 +69,11 @@ function serviceAccount(): Account
6969
expect(function () use ($service, $account): void {
7070
$service->logout($account, new RefreshToken('refresh'));
7171
})
72-
->toThrow(\ownHackathon\App\Http\Exception\HttpUnauthorizedException::class);
72+
->toThrow(\ownHackathon\Core\Http\Exception\HttpUnauthorizedException::class);
7373
expect(function () use ($service, $account): void {
7474
$service->logout($account, new RefreshToken('refresh'));
7575
})
76-
->toThrow(\ownHackathon\App\Http\Exception\HttpUnauthorizedException::class);
76+
->toThrow(\ownHackathon\Core\Http\Exception\HttpUnauthorizedException::class);
7777
});
7878

7979
test('password mismatch exception keeps its email', function (): void {

0 commit comments

Comments
 (0)