SeedTest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 78
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
A setTitleForStringSetsTitle() 0 10 1
A setTitleReturnsSelf() 0 4 1
A setPropertiesForArraySetsProperties() 0 6 1
A setPropertiesReturnsSelf() 0 4 1
1
<?php
2
namespace TildBJ\Seeder\Tests\Unit\Domain\Model;
3
4
/***************************************************************
5
 *  Copyright notice
6
 *
7
 *  (c) 2016 Dennis Römmich <[email protected]>
8
 *
9
 *  All rights reserved
10
 *
11
 *  This script is part of the TYPO3 project. The TYPO3 project is
12
 *  free software; you can redistribute it and/or modify
13
 *  it under the terms of the GNU General Public License as published by
14
 *  the Free Software Foundation; either version 2 of the License, or
15
 *  (at your option) any later version.
16
 *
17
 *  The GNU General Public License can be found at
18
 *  http://www.gnu.org/copyleft/gpl.html.
19
 *
20
 *  This script is distributed in the hope that it will be useful,
21
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
22
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
 *  GNU General Public License for more details.
24
 *
25
 *  This copyright notice MUST APPEAR in all copies of the script!
26
 ***************************************************************/
27
use TildBJ\Seeder\Domain\Model\Seed;
28
use Nimut\TestingFramework\TestCase\UnitTestCase;
29
30
/**
31
 * SeedTest
32
 *
33
 * @author Dennis Römmich<[email protected]>
34
 * @copyright Copyright belongs to the respective authors
35
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
36
 */
37
class SeedTest extends UnitTestCase
38
{
39
40
    /**
41
     * subject
42
     *
43
     * @var Seed $subject
44
     */
45
    protected $subject;
46
47
    /**
48
     * Properties
49
     */
50
    protected $properties = [
51
        'key' => 'value',
52
        'foo' => 'bar',
53
    ];
54
55
    /**
56
     * setUp
57
     *
58
     * @return void
59
     */
60
    public function setUp()
61
    {
62
        parent::setUp();
63
64
        $this->subject = new Seed();
65
    }
66
67
    /**
68
     * setTitleForStringSetsTitle
69
     *
70
     * @test
71
     */
72
    public function setTitleForStringSetsTitle()
73
    {
74
        $this->subject->setTitle('MyTitle');
75
76
        $this->assertAttributeEquals(
77
            'MyTitle',
78
            'title',
79
            $this->subject
80
        );
81
    }
82
83
    /**
84
     * setTitleReturnsSelf
85
     *
86
     * @test
87
     */
88
    public function setTitleReturnsSelf()
89
    {
90
        $this->assertEquals($this->subject, $this->subject->setTitle('FooBar'));
91
    }
92
93
    /**
94
     * setPropertiesForArraySetsProperties
95
     *
96
     * @test
97
     */
98
    public function setPropertiesForArraySetsProperties()
99
    {
100
        $this->subject->setProperties($this->properties);
101
102
        $this->assertAttributeEquals($this->properties, 'properties', $this->subject);
103
    }
104
105
    /**
106
     * setPropertiesReturnsSelf
107
     *
108
     * @test
109
     */
110
    public function setPropertiesReturnsSelf()
111
    {
112
        $this->assertEquals($this->subject, $this->subject->setProperties($this->properties));
113
    }
114
}
115