|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Aimeos\ShopBundle\Tests\Entity; |
|
4
|
|
|
|
|
5
|
|
|
|
|
6
|
|
|
use Aimeos\ShopBundle\Entity\FosUser; |
|
7
|
|
|
|
|
8
|
|
|
|
|
9
|
|
|
class FosUserTest extends \PHPUnit\Framework\TestCase |
|
10
|
|
|
{ |
|
11
|
|
|
private $object; |
|
12
|
|
|
|
|
13
|
|
|
|
|
14
|
|
|
protected function setUp() : void |
|
15
|
|
|
{ |
|
16
|
|
|
$this->object = new FosUser(); |
|
17
|
|
|
} |
|
18
|
|
|
|
|
19
|
|
|
|
|
20
|
|
|
public function testGetId() |
|
21
|
|
|
{ |
|
22
|
|
|
$this->assertEquals( null, $this->object->getId() ); |
|
23
|
|
|
} |
|
24
|
|
|
|
|
25
|
|
|
|
|
26
|
|
|
public function testGetSetCompany() |
|
27
|
|
|
{ |
|
28
|
|
|
$this->object->setCompany( 'ABC' ); |
|
29
|
|
|
$this->assertEquals( 'ABC', $this->object->getCompany() ); |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
|
|
33
|
|
|
public function testGetSetVatID() |
|
34
|
|
|
{ |
|
35
|
|
|
$this->object->setVatID( 'AT0000' ); |
|
36
|
|
|
$this->assertEquals( 'AT0000', $this->object->getVatID() ); |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
|
|
40
|
|
|
public function testGetSetSalutation() |
|
41
|
|
|
{ |
|
42
|
|
|
$this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN ); |
|
43
|
|
|
$this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_UNKNOWN, $this->object->getSalutation() ); |
|
44
|
|
|
|
|
45
|
|
|
$this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY ); |
|
46
|
|
|
$this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_COMPANY, $this->object->getSalutation() ); |
|
47
|
|
|
|
|
48
|
|
|
$this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MS ); |
|
49
|
|
|
$this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MS, $this->object->getSalutation() ); |
|
50
|
|
|
|
|
51
|
|
|
$this->object->setSalutation( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR ); |
|
52
|
|
|
$this->assertEquals( \Aimeos\MShop\Common\Item\Address\Base::SALUTATION_MR, $this->object->getSalutation() ); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
|
|
56
|
|
|
public function testGetSetTitle() |
|
57
|
|
|
{ |
|
58
|
|
|
$this->object->setTitle( 'Prof. Dr.' ); |
|
59
|
|
|
$this->assertEquals( 'Prof. Dr.', $this->object->getTitle() ); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
|
|
63
|
|
|
public function testGetSetFirstname() |
|
64
|
|
|
{ |
|
65
|
|
|
$this->object->setFirstname( 'first' ); |
|
66
|
|
|
$this->assertEquals( 'first', $this->object->getFirstname() ); |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
|
|
70
|
|
|
public function testGetSetLastname() |
|
71
|
|
|
{ |
|
72
|
|
|
$this->object->setLastname( 'last' ); |
|
73
|
|
|
$this->assertEquals( 'last', $this->object->getLastname() ); |
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
|
|
77
|
|
|
public function testGetSetAddress1() |
|
78
|
|
|
{ |
|
79
|
|
|
$this->object->setAddress1( 'test street' ); |
|
80
|
|
|
$this->assertEquals( 'test street', $this->object->getAddress1() ); |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
|
|
84
|
|
|
public function testGetSetAddress2() |
|
85
|
|
|
{ |
|
86
|
|
|
$this->object->setAddress2( '1' ); |
|
87
|
|
|
$this->assertEquals( '1', $this->object->getAddress2() ); |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
|
|
91
|
|
|
public function testGetSetAddress3() |
|
92
|
|
|
{ |
|
93
|
|
|
$this->object->setAddress3( 'EG' ); |
|
94
|
|
|
$this->assertEquals( 'EG', $this->object->getAddress3() ); |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
|
|
98
|
|
|
public function testGetSetPostal() |
|
99
|
|
|
{ |
|
100
|
|
|
$this->object->setPostal( '12345' ); |
|
101
|
|
|
$this->assertEquals( '12345', $this->object->getPostal() ); |
|
102
|
|
|
} |
|
103
|
|
|
|
|
104
|
|
|
|
|
105
|
|
|
public function testGetSetCity() |
|
106
|
|
|
{ |
|
107
|
|
|
$this->object->setCity( 'Munich' ); |
|
108
|
|
|
$this->assertEquals( 'Munich', $this->object->getCity() ); |
|
109
|
|
|
} |
|
110
|
|
|
|
|
111
|
|
|
|
|
112
|
|
|
public function testGetSetState() |
|
113
|
|
|
{ |
|
114
|
|
|
$this->object->setState( 'Bayern' ); |
|
115
|
|
|
$this->assertEquals( 'Bayern', $this->object->getState() ); |
|
116
|
|
|
} |
|
117
|
|
|
|
|
118
|
|
|
|
|
119
|
|
|
public function testGetSetCountryId() |
|
120
|
|
|
{ |
|
121
|
|
|
$this->object->setCountryId( 'DE' ); |
|
122
|
|
|
$this->assertEquals( 'DE', $this->object->getCountryId() ); |
|
123
|
|
|
} |
|
124
|
|
|
|
|
125
|
|
|
|
|
126
|
|
|
public function testGetSetLanguageId() |
|
127
|
|
|
{ |
|
128
|
|
|
$this->object->setLanguageId( 'de' ); |
|
129
|
|
|
$this->assertEquals( 'de', $this->object->getLanguageId() ); |
|
130
|
|
|
} |
|
131
|
|
|
|
|
132
|
|
|
|
|
133
|
|
|
public function testGetSetTelephone() |
|
134
|
|
|
{ |
|
135
|
|
|
$this->object->setTelephone( '089123456789' ); |
|
136
|
|
|
$this->assertEquals( '089123456789', $this->object->getTelephone() ); |
|
137
|
|
|
} |
|
138
|
|
|
|
|
139
|
|
|
|
|
140
|
|
|
public function testGetSetTelefax() |
|
141
|
|
|
{ |
|
142
|
|
|
$this->object->setTelefax( '089987654321' ); |
|
143
|
|
|
$this->assertEquals( '089987654321', $this->object->getTelefax() ); |
|
144
|
|
|
} |
|
145
|
|
|
|
|
146
|
|
|
|
|
147
|
|
|
public function testGetSetWebsite() |
|
148
|
|
|
{ |
|
149
|
|
|
$this->object->setWebsite( 'http://aimeos.org' ); |
|
150
|
|
|
$this->assertEquals( 'http://aimeos.org', $this->object->getWebsite() ); |
|
151
|
|
|
} |
|
152
|
|
|
|
|
153
|
|
|
|
|
154
|
|
|
public function testSetWebsiteInvalid() |
|
155
|
|
|
{ |
|
156
|
|
|
$this->expectException( \Exception::class ); |
|
157
|
|
|
$this->object->setWebsite( 'aimeos+org' ); |
|
158
|
|
|
} |
|
159
|
|
|
} |
|
160
|
|
|
|