|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* YAWIK |
|
4
|
|
|
* |
|
5
|
|
|
* @filesource |
|
6
|
|
|
* @license MIT |
|
7
|
|
|
* @copyright 2013 - 2015 Cross Solution <http://cross-solution.de> |
|
8
|
|
|
*/ |
|
9
|
|
|
|
|
10
|
|
|
/** */ |
|
11
|
|
|
namespace ApplicationsTest\Entity; |
|
12
|
|
|
|
|
13
|
|
|
use Applications\Entity\Application; |
|
14
|
|
|
use Jobs\Entity\Job; |
|
15
|
|
|
use JobsTest\Entity\Provider\JobEntityProvider; |
|
16
|
|
|
|
|
17
|
|
|
/** |
|
18
|
|
|
* Tests for Jobs Entity |
|
19
|
|
|
* |
|
20
|
|
|
* @covers \Applications\Entity\Application |
|
21
|
|
|
* @coversDefaultClass \Applications\Entity\Application |
|
22
|
|
|
* |
|
23
|
|
|
* @author Carsten Bleek <[email protected]> |
|
24
|
|
|
* @group Jobs |
|
25
|
|
|
* @group Jobs.Entity |
|
26
|
|
|
*/ |
|
27
|
|
|
class ApplicationsTest extends \PHPUnit_Framework_TestCase |
|
28
|
|
|
{ |
|
29
|
|
|
/** |
|
30
|
|
|
* The "Class under Test" |
|
31
|
|
|
* |
|
32
|
|
|
* @var Application |
|
33
|
|
|
*/ |
|
34
|
|
|
private $target; |
|
35
|
|
|
|
|
36
|
|
|
public function setup() |
|
37
|
|
|
{ |
|
38
|
|
|
$this->target = new Application(); |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @testdox Extends \Core\Entity\AbstractEntity and implements \Jobs\Entity\ApplicationInterface |
|
43
|
|
|
* @coversNothing |
|
44
|
|
|
*/ |
|
45
|
|
|
public function testExtendsAbstractEntityAndImplementsApplicationInterface() |
|
46
|
|
|
{ |
|
47
|
|
|
$this->assertInstanceOf('\Core\Entity\AbstractEntity', $this->target); |
|
48
|
|
|
$this->assertInstanceOf('\Applications\Entity\ApplicationInterface', $this->target); |
|
49
|
|
|
$this->assertInstanceOf('\Zend\Permissions\Acl\Resource\ResourceInterface', $this->target); |
|
50
|
|
|
$this->assertInstanceOf('\Core\Entity\DraftableEntityInterface', $this->target); |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @testdox Allows setting a the cover letter |
|
55
|
|
|
* @covers Applications\Entity\Application::getSummary |
|
56
|
|
|
* @covers Applications\Entity\Application::setSummary |
|
57
|
|
|
*/ |
|
58
|
|
|
public function testSetGetSummary() |
|
59
|
|
|
{ |
|
60
|
|
|
$input = 'Sehr geehrte Damen und Herren'; |
|
61
|
|
|
$this->target->setSummary($input); |
|
62
|
|
|
$this->assertEquals($input, $this->target->getSummary()); |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* @testdox Allows setting searchable keywords |
|
67
|
|
|
* @covers Applications\Entity\Application::getKeywords |
|
68
|
|
|
* @covers Applications\Entity\Application::setKeywords |
|
69
|
|
|
* @covers Applications\Entity\Application::clearKeywords |
|
70
|
|
|
*/ |
|
71
|
|
|
public function testSetGetKeywords() |
|
72
|
|
|
{ |
|
73
|
|
|
$input = array('Sehr',' geehrte',' Damen' ,'und' ,'Herren'); |
|
74
|
|
|
$this->target->setKeywords($input); |
|
75
|
|
|
$this->assertEquals($input, $this->target->getKeywords()); |
|
76
|
|
|
$this->target->clearKeywords(); |
|
77
|
|
|
$this->assertEquals(array(), $this->target->getKeywords()); |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* @testdox Allows setting a the cover letter |
|
83
|
|
|
* @covers Applications\Entity\Application::isDraft |
|
84
|
|
|
* @covers Applications\Entity\Application::setIsDraft |
|
85
|
|
|
*/ |
|
86
|
|
|
public function testSetGetIsDraft() |
|
87
|
|
|
{ |
|
88
|
|
|
$input = true; |
|
89
|
|
|
$this->target->setIsDraft($input); |
|
90
|
|
|
$this->assertEquals($input, $this->target->isDraft()); |
|
91
|
|
|
$input = false; |
|
92
|
|
|
$this->target->setIsDraft($input); |
|
93
|
|
|
$this->assertEquals($input, $this->target->isDraft()); |
|
94
|
|
|
} |
|
95
|
|
|
} |