Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function testGetDocumentValueForNumbers() |
||
11 | { |
||
12 | $int = 123; |
||
13 | $double = 123.83; |
||
14 | |||
15 | $entity = new \stdClass(); |
||
16 | $field = new DoubleField('price', 'd_price', false, 10, false); |
||
|
|||
17 | |||
18 | $entity->price = $double; |
||
19 | $fieldValue = $field->getDocumentFieldValue($entity); |
||
20 | $this->assertEquals(123.83 ,$fieldValue); |
||
21 | |||
22 | $entity->price = $int; |
||
23 | $fieldValue = $field->getDocumentFieldValue($entity); |
||
24 | $this->assertEquals(123.00 ,$fieldValue); |
||
25 | |||
52 | } |