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