Skip to content

Commit

Permalink
test fixes and additions
Browse files Browse the repository at this point in the history
  • Loading branch information
SeemaMenon committed Oct 14, 2024
1 parent c6508fe commit 9916ce0
Show file tree
Hide file tree
Showing 15 changed files with 397 additions and 16 deletions.
8 changes: 8 additions & 0 deletions service-api/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions service-api/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions service-api/.idea/php-test-framework.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

224 changes: 224 additions & 0 deletions service-api/.idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions service-api/.idea/phpunit.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions service-api/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion service-front/app/src/Common/src/Entity/CombinedLpa.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
use Common\Enum\LifeSustainingTreatment;
use Common\Enum\LpaType;
use DateTimeImmutable;
use EventSauce\ObjectHydrator\DoNotSerialize;
use JsonSerializable;

class CombinedLpa
class CombinedLpa implements JsonSerializable
{
public function __construct(

Check warning on line 16 in service-front/app/src/Common/src/Entity/CombinedLpa.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/CombinedLpa.php#L16

Added line #L16 was not covered by tests
public readonly ?bool $applicationHasGuidance,
Expand Down Expand Up @@ -38,4 +40,18 @@ public function __construct(
public readonly ?DateTimeImmutable $withdrawnDate,
) {
}

#[DoNotSerialize]

Check warning on line 44 in service-front/app/src/Common/src/Entity/CombinedLpa.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/CombinedLpa.php#L44

Added line #L44 was not covered by tests
public function jsonSerialize(): mixed
{
$data = get_object_vars($this);

Check warning on line 47 in service-front/app/src/Common/src/Entity/CombinedLpa.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/CombinedLpa.php#L47

Added line #L47 was not covered by tests

array_walk($data, function (&$value) {
if ($value instanceof DateTimeImmutable) {
$value = $value->format('Y-m-d H:i:s.uO');

Check warning on line 51 in service-front/app/src/Common/src/Entity/CombinedLpa.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/CombinedLpa.php#L49-L51

Added lines #L49 - L51 were not covered by tests
}
});

Check warning on line 53 in service-front/app/src/Common/src/Entity/CombinedLpa.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/CombinedLpa.php#L53

Added line #L53 was not covered by tests

return $data;

Check warning on line 55 in service-front/app/src/Common/src/Entity/CombinedLpa.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/CombinedLpa.php#L55

Added line #L55 was not covered by tests
}
}
19 changes: 18 additions & 1 deletion service-front/app/src/Common/src/Entity/LpaStore/LpaStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@
use Common\Enum\LifeSustainingTreatment;
use Common\Enum\LpaType;
use DateTimeImmutable;
use EventSauce\ObjectHydrator\DoNotSerialize;
use EventSauce\ObjectHydrator\MapFrom;
use EventSauce\ObjectHydrator\PropertyCasters\CastListToType;
use JsonSerializable;

class LpaStore extends CombinedLpa

class LpaStore extends CombinedLpa implements JsonSerializable
{
public function __construct(

Check warning on line 24 in service-front/app/src/Common/src/Entity/LpaStore/LpaStore.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/LpaStore/LpaStore.php#L24

Added line #L24 was not covered by tests
?bool $applicationHasGuidance,
Expand Down Expand Up @@ -82,4 +85,18 @@ public function __construct(
$withdrawnDate

Check warning on line 85 in service-front/app/src/Common/src/Entity/LpaStore/LpaStore.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/LpaStore/LpaStore.php#L61-L85

Added lines #L61 - L85 were not covered by tests
);
}

#[DoNotSerialize]

Check warning on line 89 in service-front/app/src/Common/src/Entity/LpaStore/LpaStore.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/LpaStore/LpaStore.php#L89

Added line #L89 was not covered by tests
public function jsonSerialize(): mixed
{
$data = get_object_vars($this);

Check warning on line 92 in service-front/app/src/Common/src/Entity/LpaStore/LpaStore.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/LpaStore/LpaStore.php#L92

Added line #L92 was not covered by tests

array_walk($data, function (&$value) {
if ($value instanceof DateTimeImmutable) {
$value = $value->format('Y-m-d H:i:s.uO');

Check warning on line 96 in service-front/app/src/Common/src/Entity/LpaStore/LpaStore.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/LpaStore/LpaStore.php#L94-L96

Added lines #L94 - L96 were not covered by tests
}
});

Check warning on line 98 in service-front/app/src/Common/src/Entity/LpaStore/LpaStore.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/LpaStore/LpaStore.php#L98

Added line #L98 was not covered by tests

return $data;

Check warning on line 100 in service-front/app/src/Common/src/Entity/LpaStore/LpaStore.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/LpaStore/LpaStore.php#L100

Added line #L100 was not covered by tests
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
use Common\Entity\Casters\ExtractTownFromLpaStore;
use Common\Entity\Person;
use DateTimeImmutable;
use EventSauce\ObjectHydrator\DoNotSerialize;
use EventSauce\ObjectHydrator\MapFrom;
use JsonSerializable;

class LpaStoreAttorney extends Person
class LpaStoreAttorney extends Person implements JsonSerializable
{
public function __construct(

Check warning on line 18 in service-front/app/src/Common/src/Entity/LpaStore/LpaStoreAttorney.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/LpaStore/LpaStoreAttorney.php#L18

Added line #L18 was not covered by tests
#[MapFrom('address')]
Expand Down Expand Up @@ -64,4 +66,18 @@ public function __construct(
$uId,

Check warning on line 66 in service-front/app/src/Common/src/Entity/LpaStore/LpaStoreAttorney.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/LpaStore/LpaStoreAttorney.php#L49-L66

Added lines #L49 - L66 were not covered by tests
);
}

#[DoNotSerialize]

Check warning on line 70 in service-front/app/src/Common/src/Entity/LpaStore/LpaStoreAttorney.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/LpaStore/LpaStoreAttorney.php#L70

Added line #L70 was not covered by tests
public function jsonSerialize(): mixed
{
$data = get_object_vars($this);

Check warning on line 73 in service-front/app/src/Common/src/Entity/LpaStore/LpaStoreAttorney.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/LpaStore/LpaStoreAttorney.php#L73

Added line #L73 was not covered by tests

array_walk($data, function (&$value) {
if ($value instanceof DateTimeImmutable) {
$value = $value->format('Y-m-d H:i:s.uO');

Check warning on line 77 in service-front/app/src/Common/src/Entity/LpaStore/LpaStoreAttorney.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/LpaStore/LpaStoreAttorney.php#L75-L77

Added lines #L75 - L77 were not covered by tests
}
});

Check warning on line 79 in service-front/app/src/Common/src/Entity/LpaStore/LpaStoreAttorney.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/LpaStore/LpaStoreAttorney.php#L79

Added line #L79 was not covered by tests

return $data;

Check warning on line 81 in service-front/app/src/Common/src/Entity/LpaStore/LpaStoreAttorney.php

View check run for this annotation

Codecov / codecov/patch

service-front/app/src/Common/src/Entity/LpaStore/LpaStoreAttorney.php#L81

Added line #L81 was not covered by tests
}
}
Loading

0 comments on commit 9916ce0

Please sign in to comment.