AbstractDataTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getExpectedInvoiceData() 0 16 1
1
<?php
2
3
/**
4
 * apparat/resource
5
 *
6
 * @category    Jkphl
7
 * @package     Jkphl_apparat/resource
8
 * @author      Joschi Kuphal <[email protected]> / @jkphl
9
 * @copyright   Copyright © 2016 Joschi Kuphal <[email protected]> / @jkphl
10
 * @license     http://opensource.org/licenses/MIT The MIT License (MIT)
11
 */
12
13
/***********************************************************************************
14
 *  The MIT License (MIT)
15
 *
16
 *  Copyright © 2015 Joschi Kuphal <[email protected]> / @jkphl
17
 *
18
 *  Permission is hereby granted, free of charge, to any person obtaining a copy of
19
 *  this software and associated documentation files (the "Software"), to deal in
20
 *  the Software without restriction, including without limitation the rights to
21
 *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
22
 *  the Software, and to permit persons to whom the Software is furnished to do so,
23
 *  subject to the following conditions:
24
 *
25
 *  The above copyright notice and this permission notice shall be included in all
26
 *  copies or substantial portions of the Software.
27
 *
28
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29
 *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
30
 *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
31
 *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
32
 *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
33
 *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34
 ***********************************************************************************/
35
36
namespace Apparat\Resource\Tests;
37
38
use Apparat\Dev\Tests\AbstractTest;
39
40
/**
41
 * Abstract data tests
42
 *
43
 * @package Apparat\Resource\Tests
44
 * @subpackage Apparat\Resource\Tests
45
 */
46
abstract class AbstractDataTest extends AbstractTest
47
{
48
    /**
49
     * Create expected invoice data
50
     *
51
     * @return array Expected data
52
     */
53
    protected function getExpectedInvoiceData()
54
    {
55
        // Prepare modified expected data
56
        $expectedData = include __DIR__.DIRECTORY_SEPARATOR.'Fixture'.DIRECTORY_SEPARATOR.'invoice.php';
57
        $expectedData['date'] = time();
58
        $expectedData['bill-to']['given'] = 'John';
59
        $expectedData['bill-to']['family'] = 'Doe';
60
        $expectedData['product'][] = [
61
            'sku' => 'ABC123',
62
            'quantity' => 1,
63
            'description' => 'Dummy',
64
            'price' => 123
65
        ];
66
        unset($expectedData['comments']);
67
        return $expectedData;
68
    }
69
}
70