Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
29 | public function testSimpleDiscount() |
||
30 | { |
||
31 | $date = '2018-08-01'; |
||
32 | $rate = '2'; |
||
33 | $reason = 'test reason'; |
||
34 | $formula = $this->engine->build("discount.fixed('$rate%').since('$date').reason('$reason')"); |
||
35 | |||
36 | $this->assertInstanceOf(FixedDiscount::class, $formula); |
||
37 | $this->assertSame($rate, $formula->getValue()); |
||
38 | $this->assertTrue($formula->isRelative()); |
||
39 | $this->assertInstanceOf(Since::class, $formula->getSince()); |
||
40 | $this->assertEquals(new DateTimeImmutable($date), $formula->getSince()->getValue()); |
||
41 | $this->assertInstanceOf(Reason::class, $formula->getReason()); |
||
42 | $this->assertSame($reason, $formula->getReason()->getValue()); |
||
43 | $this->assertNull($formula->getTill()); |
||
44 | } |
||
45 | } |
||
46 |