Completed
Push — master ( b74cd0...088e4f )
by Dennis
11:47
created

SeedTest   A

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
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 78
rs 10

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 Dennis\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 Dennis\Seeder\Domain\Model\Seed;
28
use TYPO3\CMS\Core\Tests\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
0 ignored issues
show
Deprecated Code introduced by
The class TYPO3\CMS\Core\Tests\UnitTestCase has been deprecated with message: will be removed once TYPO3 9 LTS is released

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
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