Skip to content

Commit 37c07ba

Browse files
HP-1631: modernized RestateActionsServiceTest Unit test
1 parent 22c85c2 commit 37c07ba

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

src/plan/Plan.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ public function getId()
8585
return $this->id;
8686
}
8787

88+
public function setId(int $id): void
89+
{
90+
$this->id = $id;
91+
}
92+
8893
/**
8994
* @return string
9095
*/

src/plan/PlanInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ interface PlanInterface extends EntityInterface
2828
*/
2929
public function getId();
3030

31+
public function setId(int $id): void;
32+
3133
/**
3234
* Globally unique ID.
3335
* @return int|string
@@ -38,15 +40,20 @@ public function getUniqueId();
3840
* @return PriceInterface[]
3941
*/
4042
public function getPrices(): array;
43+
4144
public function hasPrices(): bool;
4245

4346
/**
4447
* @param PriceInterface[] $prices
4548
* @throws CannotReassignException when prices are already set
4649
*/
4750
public function setPrices(array $prices): void;
51+
4852
public function getSeller(): ?CustomerInterface;
53+
4954
public function getName(): string;
55+
5056
public function setName(string $name): void;
57+
5158
public function getType(): ?TypeInterface;
5259
}

src/plan/PlanRepositoryInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,6 @@ public function findByIds(array $ids);
4242
* @throws EntityNotFoundException
4343
*/
4444
public function getById(int $id): PlanInterface;
45+
46+
public function save(PlanInterface $action): void;
4547
}

src/tools/FactoryInterface.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111

1212
namespace hiqdev\php\billing\tools;
1313

14+
use hiqdev\php\billing\action\ActionInterface;
15+
use hiqdev\php\billing\plan\PlanInterface;
16+
use hiqdev\php\billing\sale\SaleInterface;
17+
1418
/**
1519
* @author Andrii Vasyliev <sol@hiqdev.com>
1620
*/
@@ -20,4 +24,10 @@ interface FactoryInterface
2024
* Create billing object by entity name and data.
2125
*/
2226
public function create(string $entity, $data);
27+
28+
public function getSale($data): SaleInterface;
29+
30+
public function getAction($data): ActionInterface;
31+
32+
public function getPlan($data): PlanInterface;
2333
}

0 commit comments

Comments
 (0)