/
AttributesTest.php
81 lines (72 loc) · 1.98 KB
/
AttributesTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
/**
* YAWIK
*
* @filesource
* @license MIT
* @copyright 2013 - 2016 Cross Solution <http://cross-solution.de>
*/
/** */
namespace ApplicationsTest\Entity;
use PHPUnit\Framework\TestCase;
use Applications\Entity\Attributes;
/**
* Tests the Attributes entity.
*
* @covers \Applications\Entity\Attributes
* @author Carsten Bleek <bleek@cross-solution.de>
* @group Applications
* @group Applications.Entity
*/
class AttributesTest extends TestCase
{
/**
* @var \Applications\Entity\Attributes
*/
private $target;
protected function setUp(): void
{
$this->target = new Attributes();
}
/**
* @testdox Extends \Core\Entity\AbstractEntity
*/
public function testExtendsAbstractEntity()
{
$this->assertInstanceOf('\Core\Entity\AbstractEntity', $this->target);
}
/**
* @dataProvider providerBooleanValues
* @testdox test the privacy policy flag
* @covers \Applications\Entity\Attributes::getAcceptedPrivacyPolicy
* @covers \Applications\Entity\Attributes::setAcceptedPrivacyPolicy
*/
public function testSetGetPrivacyPolicy($input, $expected)
{
$this->target->setAcceptedPrivacyPolicy($input);
$this->assertEquals($expected, $this->target->getAcceptedPrivacyPolicy());
}
/**
* @dataProvider providerBooleanValues
* @testdox test the send carbon copy flag
* @covers \Applications\Entity\Attributes::getSendCarbonCopy
* @covers \Applications\Entity\Attributes::setSendCarbonCopy
*/
public function testSetGetSendCarbonCopy($input, $expected)
{
$this->target->setSendCarbonCopy($input);
$this->assertEquals($expected, $this->target->getSendCarbonCopy());
}
public function providerBooleanValues()
{
return [
[1, true],
[0, false],
[true, true],
[false, false],
["true", true],
["false", true],
[null, false]
];
}
}