PaymentSlipTestCase::assertElementsArray()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 7
rs 10
1
<?php
2
/**
3
 * Swiss Payment Slip
4
 *
5
 * @license http://www.opensource.org/licenses/mit-license.php MIT License
6
 * @copyright 2012-2016 Some nice Swiss guys
7
 * @author Marc Würth [email protected]
8
 * @author Manuel Reinhard <[email protected]>
9
 * @author Peter Siska <[email protected]>
10
 * @link https://github.com/ravage84/SwissPaymentSlip/
11
 */
12
13
namespace SwissPaymentSlip\SwissPaymentSlip\Tests;
14
15
use SwissPaymentSlip\SwissPaymentSlip\PaymentSlipData;
16
use SwissPaymentSlip\SwissPaymentSlip\PaymentSlip;
17
18
/**
19
 * A test case for all common payment slip test code
20
 */
21
class PaymentSlipTestCase extends \PHPUnit_Framework_TestCase
22
{
23
    /**
24
     * The data container for the object under test
25
     *
26
     * @var PaymentSlipData
27
     */
28
    protected $slipData;
29
30
    /**
31
     * The object under test
32
     *
33
     * @var PaymentSlip
34
     */
35
    protected $paymentSlip;
36
37
    /**
38
     * The default attributes to test against
39
     *
40
     * @var array
41
     */
42
    protected $defaultAttributes;
43
44
    /**
45
     * The set attributes to test against
46
     *
47
     * @var array
48
     */
49
    protected $setAttributes;
50
51
    /**
52
     * Assert an array of elements with their lines and attributes
53
     *
54
     * @param array $expectedElements The expected elements array.
55
     * @param array $elements The actual elements array.
56
     */
57
    protected function assertElementsArray($expectedElements, $elements)
58
    {
59
        foreach ($expectedElements as $elementNr => $element) {
60
            $this->assertArrayHasKey($element, $elements);
61
62
            $this->assertArrayHasKey('lines', $elements[$element]);
63
            $this->assertArrayHasKey('attributes', $elements[$element]);
64
        }
65
    }
66
}
67