-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue: documentacao-e-tarefas/desenvolvimento_e_infra#892 Signed-off-by: Thiago <thiago@lepidus.com.br>
- Loading branch information
1 parent
454df9d
commit 0609cf7
Showing
3 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace ThothClient\GraphQL\Model; | ||
|
||
class Price extends AbstractModel | ||
{ | ||
public function getPriceId(): string | ||
{ | ||
return $this->getData('priceId'); | ||
} | ||
|
||
public function setPriceId(string $priceId): void | ||
{ | ||
$this->setData('priceId', $priceId); | ||
} | ||
|
||
public function getPublicationId(): string | ||
{ | ||
return $this->getData('publicationId'); | ||
} | ||
|
||
public function setPublicationId(string $publicationId): void | ||
{ | ||
$this->setData('publicationId', $publicationId); | ||
} | ||
|
||
public function getCurrentCode(): string | ||
{ | ||
return $this->getData('currentCode'); | ||
} | ||
|
||
public function setCurrentCode(string $currentCode): void | ||
{ | ||
$this->setData('currentCode', $currentCode); | ||
} | ||
|
||
public function getUnitPrice(): float | ||
{ | ||
return $this->getData('unitPrice'); | ||
} | ||
|
||
public function setUnitPrice(float $unitPrice): void | ||
{ | ||
$this->setData('unitPrice', $unitPrice); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace ThothClient\Tests\GraphQL\Model; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use ThothClient\GraphQL\Model\Price; | ||
|
||
final class PriceTest extends TestCase | ||
{ | ||
public function testGettersAndSetters(): void | ||
{ | ||
$priceId = 'f026cdd8-3728-430a-a0d6-af18f8bbe2b7'; | ||
$publicationId = '235a8a7b-830a-4828-b231-7e539fb25fcb'; | ||
$currentCode = 'USD'; | ||
$unitPrice = 12.0; | ||
|
||
$price = new Price(); | ||
$price->setPriceId($priceId); | ||
$price->setPublicationId($publicationId); | ||
$price->setCurrentCode($currentCode); | ||
$price->setUnitPrice($unitPrice); | ||
|
||
$this->assertSame($priceId, $price->getPriceId()); | ||
$this->assertSame($publicationId, $price->getPublicationId()); | ||
$this->assertSame($currentCode, $price->getCurrentCode()); | ||
$this->assertSame($unitPrice, $price->getUnitPrice()); | ||
} | ||
} |