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