Completed
Push — master ( f39c0d...d229d7 )
by Tomas Norre
21:25 queued 19:23
created

GolfCourseTest::setLogoForFileReferenceSetsLogo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
namespace TNM\GolfCourses\Tests\Unit\Domain\Model;
4
5
/***************************************************************
6
 *  Copyright notice
7
 *
8
 *  (c) 2016 Tomas Norre Mikkelsen <[email protected]>
9
 *
10
 *  All rights reserved
11
 *
12
 *  This script is part of the TYPO3 project. The TYPO3 project is
13
 *  free software; you can redistribute it and/or modify
14
 *  it under the terms of the GNU General Public License as published by
15
 *  the Free Software Foundation; either version 2 of the License, or
16
 *  (at your option) any later version.
17
 *
18
 *  The GNU General Public License can be found at
19
 *  http://www.gnu.org/copyleft/gpl.html.
20
 *
21
 *  This script is distributed in the hope that it will be useful,
22
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
23
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
 *  GNU General Public License for more details.
25
 *
26
 *  This copyright notice MUST APPEAR in all copies of the script!
27
 ***************************************************************/
28
29
/**
30
 * Test case for class \TNM\GolfCourses\Domain\Model\GolfCourse.
31
 *
32
 * @copyright Copyright belongs to the respective authors
33
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License, version 3 or later
34
 *
35
 * @author Tomas Norre Mikkelsen <[email protected]>
36
 */
37
class GolfCourseTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
38
{
39
	/**
40
	 * @var \TNM\GolfCourses\Domain\Model\GolfCourse
41
	 */
42
	protected $subject = NULL;
43
44
	public function setUp()
45
	{
46
		$this->subject = new \TNM\GolfCourses\Domain\Model\GolfCourse();
47
	}
48
49
	public function tearDown()
50
	{
51
		unset($this->subject);
52
	}
53
54
	/**
55
	 * @test
56
	 */
57
	public function getNameReturnsInitialValueForString()
58
	{
59
		$this->assertSame(
60
			'',
61
			$this->subject->getName()
62
		);
63
	}
64
65
	/**
66
	 * @test
67
	 */
68
	public function setNameForStringSetsName()
69
	{
70
		$this->subject->setName('Conceived at T3CON10');
71
72
		$this->assertAttributeEquals(
73
			'Conceived at T3CON10',
74
			'name',
75
			$this->subject
76
		);
77
	}
78
79
	/**
80
	 * @test
81
	 */
82
	public function getWebsiteReturnsInitialValueForString()
83
	{
84
		$this->assertSame(
85
			'',
86
			$this->subject->getWebsite()
87
		);
88
	}
89
90
	/**
91
	 * @test
92
	 */
93
	public function setWebsiteForStringSetsWebsite()
94
	{
95
		$this->subject->setWebsite('Conceived at T3CON10');
96
97
		$this->assertAttributeEquals(
98
			'Conceived at T3CON10',
99
			'website',
100
			$this->subject
101
		);
102
	}
103
104
	/**
105
	 * @test
106
	 */
107
	public function getCommentReturnsInitialValueForString()
108
	{
109
		$this->assertSame(
110
			'',
111
			$this->subject->getComment()
112
		);
113
	}
114
115
	/**
116
	 * @test
117
	 */
118
	public function setCommentForStringSetsComment()
119
	{
120
		$this->subject->setComment('Conceived at T3CON10');
121
122
		$this->assertAttributeEquals(
123
			'Conceived at T3CON10',
124
			'comment',
125
			$this->subject
126
		);
127
	}
128
129
	/**
130
	 * @test
131
	 */
132
	public function getCountryReturnsInitialValueForInt()
133
	{	}
134
135
	/**
136
	 * @test
137
	 */
138
	public function setCountryForIntSetsCountry()
139
	{	}
140
141
	/**
142
	 * @test
143
	 */
144
	public function getLogoReturnsInitialValueForFileReference()
145
	{
146
		$this->assertEquals(
147
			NULL,
148
			$this->subject->getLogo()
149
		);
150
	}
151
152
	/**
153
	 * @test
154
	 */
155
	public function setLogoForFileReferenceSetsLogo()
156
	{
157
		$fileReferenceFixture = new \TYPO3\CMS\Extbase\Domain\Model\FileReference();
158
		$this->subject->setLogo($fileReferenceFixture);
159
160
		$this->assertAttributeEquals(
161
			$fileReferenceFixture,
162
			'logo',
163
			$this->subject
164
		);
165
	}
166
}
167