TYPO3 CMS  TYPO3_6-2
FrontendUserTest.php
Go to the documentation of this file.
1 <?php
3 
21 
25  protected $fixture = NULL;
26 
27  public function setUp() {
28  $this->fixture = new \TYPO3\CMS\Extbase\Domain\Model\FrontendUser();
29  }
30 
35  $this->assertSame('', $this->fixture->getUsername());
36  }
37 
41  public function setUsernameSetsUsername() {
42  $username = 'don.juan';
43  $this->fixture->setUsername($username);
44  $this->assertSame($username, $this->fixture->getUsername());
45  }
46 
51  $this->assertSame('', $this->fixture->getPassword());
52  }
53 
57  public function setPasswordSetsPassword() {
58  $password = 'f00Bar';
59  $this->fixture->setPassword($password);
60  $this->assertSame($password, $this->fixture->getPassword());
61  }
62 
66  public function setUsergroupSetsUsergroup() {
67  $usergroup = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
68  $usergroup->attach(new \TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup('foo'));
69  $this->fixture->setUsergroup($usergroup);
70  $this->assertSame($usergroup, $this->fixture->getUsergroup());
71  }
72 
76  public function addUsergroupAddsUserGroup() {
77  $usergroup = new \TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup('foo');
78  $this->assertEquals(count($this->fixture->getUsergroup()), 0);
79  $this->fixture->addUsergroup($usergroup);
80  $this->assertEquals(count($this->fixture->getUsergroup()), 1);
81  }
82 
86  public function removeUsergroupRemovesUsergroup() {
87  $usergroup = new \TYPO3\CMS\Extbase\Domain\Model\FrontendUserGroup('foo');
88  $this->fixture->addUsergroup($usergroup);
89  $this->assertEquals(count($this->fixture->getUsergroup()), 1);
90  $this->fixture->removeUsergroup($usergroup);
91  $this->assertEquals(count($this->fixture->getUsergroup()), 0);
92  }
93 
98  $this->assertSame('', $this->fixture->getName());
99  }
100 
104  public function setNameSetsName() {
105  $name = 'don juan';
106  $this->fixture->setName($name);
107  $this->assertSame($name, $this->fixture->getName());
108  }
109 
114  $this->assertSame('', $this->fixture->getFirstName());
115  }
116 
120  public function setFirstNameSetsFirstName() {
121  $firstName = 'don';
122  $this->fixture->setFirstName($firstName);
123  $this->assertSame($firstName, $this->fixture->getFirstName());
124  }
125 
130  $this->assertSame('', $this->fixture->getMiddleName());
131  }
132 
136  public function setMiddleNameSetsMiddleName() {
137  $middleName = 'miguel';
138  $this->fixture->setMiddleName($middleName);
139  $this->assertSame($middleName, $this->fixture->getMiddleName());
140  }
141 
146  $this->assertSame('', $this->fixture->getLastName());
147  }
148 
152  public function setLastNameSetsLastName() {
153  $lastName = 'juan';
154  $this->fixture->setLastName($lastName);
155  $this->assertSame($lastName, $this->fixture->getLastName());
156  }
157 
162  $this->assertSame('', $this->fixture->getAddress());
163  }
164 
168  public function setAddressSetsAddress() {
169  $address = 'foobar 42, foo';
170  $this->fixture->setAddress($address);
171  $this->assertSame($address, $this->fixture->getAddress());
172  }
173 
178  $this->assertSame('', $this->fixture->getTelephone());
179  }
180 
184  public function setTelephoneSetsTelephone() {
185  $telephone = '42';
186  $this->fixture->setTelephone($telephone);
187  $this->assertSame($telephone, $this->fixture->getTelephone());
188  }
189 
194  $this->assertSame('', $this->fixture->getFax());
195  }
196 
200  public function setFaxSetsFax() {
201  $fax = '42';
202  $this->fixture->setFax($fax);
203  $this->assertSame($fax, $this->fixture->getFax());
204  }
205 
210  $this->assertSame('', $this->fixture->getEmail());
211  }
212 
216  public function setEmailSetsEmail() {
217  $email = 'don.juan@example.com';
218  $this->fixture->setEmail($email);
219  $this->assertSame($email, $this->fixture->getEmail());
220  }
221 
226  $this->assertSame('', $this->fixture->getLockToDomain());
227  }
228 
233  $lockToDomain = 'foo.bar';
234  $this->fixture->setLockToDomain($lockToDomain);
235  $this->assertSame($lockToDomain, $this->fixture->getLockToDomain());
236  }
237 
242  $this->assertSame('', $this->fixture->getTitle());
243  }
244 
248  public function setTitleSetsTitle() {
249  $title = 'foobar';
250  $this->fixture->setTitle($title);
251  $this->assertSame($title, $this->fixture->getTitle());
252  }
253 
258  $this->assertSame('', $this->fixture->getZip());
259  }
260 
264  public function setZipSetsZip() {
265  $zip = '42';
266  $this->fixture->setZip($zip);
267  $this->assertSame($zip, $this->fixture->getZip());
268  }
269 
274  $this->assertSame('', $this->fixture->getCity());
275  }
276 
280  public function setCitySetsCity() {
281  $city = 'foo';
282  $this->fixture->setCity($city);
283  $this->assertSame($city, $this->fixture->getCity());
284  }
285 
290  $this->assertSame('', $this->fixture->getCountry());
291  }
292 
296  public function setCountrySetsCountry() {
297  $country = 'foo';
298  $this->fixture->setCountry($country);
299  $this->assertSame($country, $this->fixture->getCountry());
300  }
301 
306  $this->assertSame('', $this->fixture->getWww());
307  }
308 
312  public function setWwwSetsWww() {
313  $www = 'foo.bar';
314  $this->fixture->setWww($www);
315  $this->assertSame($www, $this->fixture->getWww());
316  }
317 
322  $this->assertSame('', $this->fixture->getCompany());
323  }
324 
328  public function setCompanySetsCompany() {
329  $company = 'foo bar';
330  $this->fixture->setCompany($company);
331  $this->assertSame($company, $this->fixture->getCompany());
332  }
333 
338  $this->assertSame('', $this->fixture->getImage());
339  }
340 
344  public function setImageSetsImage() {
345  $image = 'foobar.gif';
346  $this->fixture->setImage($image);
347  $this->assertSame($image, $this->fixture->getImage());
348  }
349 
354  $this->assertNull($this->fixture->getLastlogin());
355  }
356 
360  public function setLastloginSetsLastlogin() {
361  $date = new \DateTime();
362  $this->fixture->setLastlogin($date);
363  $this->assertSame($date, $this->fixture->getLastlogin());
364  }
365 }