1 | <?php |
||
14 | class ProductTest extends \PHPUnit\Framework\TestCase |
||
15 | { |
||
16 | protected $productInput = [ |
||
17 | 'id' => '1', |
||
18 | 'name' => 'Test product', |
||
19 | 'price' => '10', |
||
20 | 'weight' => '5', |
||
21 | 'quantity' => '4', |
||
22 | 'imagePath' => '/path_to_file/file.jpg', |
||
23 | 'taxRate' => '0.22', |
||
24 | ]; |
||
25 | |||
26 | protected $productOutput = [ |
||
27 | 'id' => '1', |
||
28 | 'name' => 'Test product', |
||
29 | 'imagePath' => '/path_to_file/file.jpg', |
||
30 | 'quantity' => 4, // converted to int |
||
31 | 'taxRate' => 0.22, // converted to double |
||
32 | 'tax' => 2.2, // converted to double |
||
33 | 'price' => 10.0, // converted to double |
||
34 | 'weight' => 5.0, // converted to double |
||
35 | 'priceWithTax' => 12.2, // converted to double |
||
36 | ]; |
||
37 | |||
38 | public function testCreateObject() |
||
54 | |||
55 | public function testSetPrice() |
||
62 | |||
63 | public function testSetPriceFormat() |
||
77 | |||
78 | public function testToArray() |
||
85 | |||
86 | |||
87 | } |
||
88 |