TYPO3 CMS  TYPO3_6-2
LanguageTest.php
Go to the documentation of this file.
1 <?php
2 
4 
22 
26  protected $fixture = NULL;
27 
31  public function setUp() {
32  $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Language();
33  }
34 
39  $this->assertSame(
40  '',
41  $this->fixture->getLocale()
42  );
43  }
44 
49  $locale = 'nl';
50  $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Language($locale);
51 
52  $this->assertSame(
53  $locale,
54  $this->fixture->getLocale()
55  );
56  }
57 
61  public function setLocaleSetsLocale() {
62  $locale = 'nl';
63  $this->fixture->setLocale($locale);
64 
65  $this->assertSame(
66  $locale,
67  $this->fixture->getLocale()
68  );
69  }
70 
75  $this->assertSame(
76  '',
77  $this->fixture->getLanguage()
78  );
79  }
80 
85  $language = 'nl';
86  $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Language('', $language);
87 
88  $this->assertSame(
89  $language,
90  $this->fixture->getLanguage()
91  );
92  }
93 
97  public function setLanguageSetsLanguage() {
98  $language = 'nl';
99  $this->fixture->setLanguage($language);
100 
101  $this->assertSame(
102  $language,
103  $this->fixture->getLanguage()
104  );
105  }
106 
111  $this->assertSame(
112  FALSE,
113  $this->fixture->getSelected()
114  );
115  }
116 
121  $selected = FALSE;
122  $this->fixture = new \TYPO3\CMS\Lang\Domain\Model\Language('', '', FALSE);
123 
124  $this->assertSame(
125  $selected,
126  $this->fixture->getSelected()
127  );
128  }
129 
133  public function setSelectedSetsSelected() {
134  $selected = TRUE;
135  $this->fixture->setSelected($selected);
136 
137  $this->assertSame(
138  $selected,
139  $this->fixture->getSelected()
140  );
141  }
142 
143 }