Skip to content

Commit

Permalink
Added the missing methods to the MemoryStore test dummy
Browse files Browse the repository at this point in the history
  • Loading branch information
fulopattila122 committed Mar 30, 2024
1 parent 698d616 commit acdbb66
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/Checkout/Tests/Example/MemoryStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Vanilo\Contracts\Billpayer;
use Vanilo\Contracts\CheckoutSubject;
use Vanilo\Contracts\DetailedAmount;
use Vanilo\Contracts\Dimension;

class MemoryStore implements CheckoutStore
{
Expand Down Expand Up @@ -142,6 +143,46 @@ public function total()
return 0;
}

public function itemsTotal(): float
{
return 0;
}

public function offsetExists(mixed $offset): bool
{
return isset($this->customAttributes[$offset]);
}

public function offsetGet(mixed $offset): mixed
{
return $this->customAttributes[$offset] ?? null;
}

public function offsetSet(mixed $offset, mixed $value): void
{
$this->customAttributes[$offset] = $value;
}

public function offsetUnset(mixed $offset): void
{
unset($this->customAttributes[$offset]);
}

public function weight(): float
{
return 0;
}

public function weightUnit(): string
{
return 'kg';
}

public function dimension(): ?Dimension
{
return new \Vanilo\Support\Dto\Dimension(0, 0, 0);
}

public function customMethod(): string
{
return 'Hey I am a custom method';
Expand Down

0 comments on commit acdbb66

Please sign in to comment.