1 | <?php |
||
9 | /** |
||
10 | * @author Adelar Tiemann Junior <[email protected]> |
||
11 | */ |
||
12 | class ChargeTest extends \PHPUnit_Framework_TestCase |
||
13 | { |
||
14 | /** |
||
15 | * @var Charge |
||
16 | */ |
||
17 | private $charge; |
||
18 | |||
19 | protected function setUp() |
||
20 | { |
||
21 | $this->charge = new Charge(); |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @test |
||
26 | */ |
||
27 | public function constructShouldConfigureTheAttributes() |
||
28 | { |
||
29 | $this->assertInstanceOf(ItemCollection::class, $this->charge->getItems()); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @test |
||
34 | */ |
||
35 | public function setReferenceShouldConfigureTheReference() |
||
36 | { |
||
37 | $charge = new Charge(); |
||
38 | $charge->setReference('SomeRef'); |
||
39 | |||
40 | $this->assertAttributeEquals('SomeRef', 'reference', $charge); |
||
41 | $this->assertEquals('SomeRef', $charge->getReference()); |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @test |
||
46 | */ |
||
47 | public function setSubscriptionCodeShouldConfigureTheSubscriptionCode() |
||
48 | { |
||
49 | $charge = new Charge(); |
||
50 | $charge->setSubscriptionCode('SomeSubscription'); |
||
51 | |||
52 | $this->assertAttributeEquals('SomeSubscription', 'subscriptionCode', $charge); |
||
53 | $this->assertEquals('SomeSubscription', $charge->getSubscriptionCode()); |
||
73 |