Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 36 |
|
0.00% |
0 / 7 |
CRAP | |
0.00% |
0 / 1 |
| WebdavTestHelper | |
0.00% |
0 / 36 |
|
0.00% |
0 / 7 |
56 | |
0.00% |
0 / 1 |
| createListCallWithDepthOne | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| createEntityList | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
2 | |||
| createListCallWithDepthThree | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| createListCallOnSubfolder | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| createPaginationCall | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
| createResourceCallOnSubfolder | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
| createUploadCall | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | namespace Apie\IntegrationTests; |
| 3 | |
| 4 | use Apie\Core\BoundedContext\BoundedContextId; |
| 5 | use Apie\Core\Entities\EntityInterface; |
| 6 | use Apie\IntegrationTests\Apie\TypeDemo\Entities\Ostrich; |
| 7 | use Apie\IntegrationTests\Apie\TypeDemo\Identifiers\AnimalIdentifier; |
| 8 | use Apie\IntegrationTests\Apie\TypeDemo\Identifiers\PrimitiveOnlyIdentifier; |
| 9 | use Apie\IntegrationTests\Apie\TypeDemo\Resources\PrimitiveOnly; |
| 10 | use Apie\IntegrationTests\Requests\ListFilesWebdavCall; |
| 11 | use Apie\IntegrationTests\Requests\UploadFileWebdavCall; |
| 12 | use Apie\IntegrationTests\Requests\WebdavTestRequestInterface; |
| 13 | use Apie\TextValueObjects\FirstName; |
| 14 | |
| 15 | class WebdavTestHelper extends IntegrationTestHelper |
| 16 | { |
| 17 | public function createListCallWithDepthOne(): WebdavTestRequestInterface |
| 18 | { |
| 19 | return new ListFilesWebdavCall(new BoundedContextId('types')); |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * @return array<int, EntityInterface> |
| 24 | */ |
| 25 | private function createEntityList(): array |
| 26 | { |
| 27 | return [ |
| 28 | new Ostrich( |
| 29 | AnimalIdentifier::fromNative('00000000-0000-0000-0000-000000000000'), |
| 30 | FirstName::fromNative('Emu') |
| 31 | ), |
| 32 | new Ostrich( |
| 33 | AnimalIdentifier::fromNative('00000000-0000-0000-0000-000000000001'), |
| 34 | FirstName::fromNative('Emu') |
| 35 | ), |
| 36 | new PrimitiveOnly( |
| 37 | PrimitiveOnlyIdentifier::fromNative('00000000-0000-0000-0000-000000000002') |
| 38 | ) |
| 39 | ]; |
| 40 | } |
| 41 | |
| 42 | public function createListCallWithDepthThree(): WebdavTestRequestInterface |
| 43 | { |
| 44 | return new ListFilesWebdavCall( |
| 45 | new BoundedContextId('types'), |
| 46 | 3, |
| 47 | entities: $this->createEntityList() |
| 48 | ); |
| 49 | } |
| 50 | |
| 51 | public function createListCallOnSubfolder(): WebdavTestRequestInterface |
| 52 | { |
| 53 | return new ListFilesWebdavCall( |
| 54 | new BoundedContextId('types'), |
| 55 | pathSuffix: '/resources' |
| 56 | ); |
| 57 | } |
| 58 | |
| 59 | public function createPaginationCall(): WebdavTestRequestInterface |
| 60 | { |
| 61 | return new ListFilesWebdavCall( |
| 62 | new BoundedContextId('types'), |
| 63 | 6, |
| 64 | entities: $this->createEntityList(), |
| 65 | pathSuffix: '/resources/Animal/0' |
| 66 | ); |
| 67 | } |
| 68 | |
| 69 | public function createResourceCallOnSubfolder(): WebdavTestRequestInterface |
| 70 | { |
| 71 | return new ListFilesWebdavCall( |
| 72 | new BoundedContextId('types'), |
| 73 | 6, |
| 74 | entities: $this->createEntityList(), |
| 75 | pathSuffix: '/resources/Animal/0/00000000-0000-0000-0000-000000000000.json' |
| 76 | ); |
| 77 | } |
| 78 | |
| 79 | public function createUploadCall(): WebdavTestRequestInterface |
| 80 | { |
| 81 | return new UploadFileWebdavCall(new BoundedContextId('types')); |
| 82 | } |
| 83 | } |