OrganizationTest.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. <?php
  2. namespace Opentalent\OtWidgets\Tests\Unit\Domain\Model;
  3. /**
  4. * Test case.
  5. *
  6. * @author Olivier Massot <olivier.massot@2iopenservice.fr>
  7. */
  8. class OrganizationTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
  9. {
  10. /**
  11. * @var \Opentalent\OtWidgets\Domain\Model\Organization
  12. */
  13. protected $subject = null;
  14. protected function setUp()
  15. {
  16. parent::setUp();
  17. $this->subject = new \Opentalent\OtWidgets\Domain\Model\Organization();
  18. }
  19. protected function tearDown()
  20. {
  21. parent::tearDown();
  22. }
  23. /**
  24. * @test
  25. */
  26. public function getIdReturnsInitialValueForString()
  27. {
  28. self::assertSame(
  29. '',
  30. $this->subject->getId()
  31. );
  32. }
  33. /**
  34. * @test
  35. */
  36. public function setIdForStringSetsId()
  37. {
  38. $this->subject->setId('Conceived at T3CON10');
  39. self::assertAttributeEquals(
  40. 'Conceived at T3CON10',
  41. 'id',
  42. $this->subject
  43. );
  44. }
  45. /**
  46. * @test
  47. */
  48. public function getTypeReturnsInitialValueForString()
  49. {
  50. self::assertSame(
  51. '',
  52. $this->subject->getType()
  53. );
  54. }
  55. /**
  56. * @test
  57. */
  58. public function setTypeForStringSetsType()
  59. {
  60. $this->subject->setType('Conceived at T3CON10');
  61. self::assertAttributeEquals(
  62. 'Conceived at T3CON10',
  63. 'type',
  64. $this->subject
  65. );
  66. }
  67. /**
  68. * @test
  69. */
  70. public function getSubDomainReturnsInitialValueForString()
  71. {
  72. self::assertSame(
  73. '',
  74. $this->subject->getSubDomain()
  75. );
  76. }
  77. /**
  78. * @test
  79. */
  80. public function setSubDomainForStringSetsSubDomain()
  81. {
  82. $this->subject->setSubDomain('Conceived at T3CON10');
  83. self::assertAttributeEquals(
  84. 'Conceived at T3CON10',
  85. 'subDomain',
  86. $this->subject
  87. );
  88. }
  89. /**
  90. * @test
  91. */
  92. public function getNameReturnsInitialValueForString()
  93. {
  94. self::assertSame(
  95. '',
  96. $this->subject->getName()
  97. );
  98. }
  99. /**
  100. * @test
  101. */
  102. public function setNameForStringSetsName()
  103. {
  104. $this->subject->setName('Conceived at T3CON10');
  105. self::assertAttributeEquals(
  106. 'Conceived at T3CON10',
  107. 'name',
  108. $this->subject
  109. );
  110. }
  111. /**
  112. * @test
  113. */
  114. public function getSlugReturnsInitialValueForString()
  115. {
  116. self::assertSame(
  117. '',
  118. $this->subject->getSlug()
  119. );
  120. }
  121. /**
  122. * @test
  123. */
  124. public function setSlugForStringSetsSlug()
  125. {
  126. $this->subject->setSlug('Conceived at T3CON10');
  127. self::assertAttributeEquals(
  128. 'Conceived at T3CON10',
  129. 'slug',
  130. $this->subject
  131. );
  132. }
  133. /**
  134. * @test
  135. */
  136. public function getPrincipalTypeReturnsInitialValueForString()
  137. {
  138. self::assertSame(
  139. '',
  140. $this->subject->getPrincipalType()
  141. );
  142. }
  143. /**
  144. * @test
  145. */
  146. public function setPrincipalTypeForStringSetsPrincipalType()
  147. {
  148. $this->subject->setPrincipalType('Conceived at T3CON10');
  149. self::assertAttributeEquals(
  150. 'Conceived at T3CON10',
  151. 'principalType',
  152. $this->subject
  153. );
  154. }
  155. /**
  156. * @test
  157. */
  158. public function getDescriptionReturnsInitialValueForString()
  159. {
  160. self::assertSame(
  161. '',
  162. $this->subject->getDescription()
  163. );
  164. }
  165. /**
  166. * @test
  167. */
  168. public function setDescriptionForStringSetsDescription()
  169. {
  170. $this->subject->setDescription('Conceived at T3CON10');
  171. self::assertAttributeEquals(
  172. 'Conceived at T3CON10',
  173. 'description',
  174. $this->subject
  175. );
  176. }
  177. /**
  178. * @test
  179. */
  180. public function getCategoriesReturnsInitialValueForInt()
  181. {
  182. self::assertSame(
  183. 0,
  184. $this->subject->getCategories()
  185. );
  186. }
  187. /**
  188. * @test
  189. */
  190. public function setCategoriesForIntSetsCategories()
  191. {
  192. $this->subject->setCategories(12);
  193. self::assertAttributeEquals(
  194. 12,
  195. 'categories',
  196. $this->subject
  197. );
  198. }
  199. /**
  200. * @test
  201. */
  202. public function getAddressCityReturnsInitialValueForString()
  203. {
  204. self::assertSame(
  205. '',
  206. $this->subject->getAddressCity()
  207. );
  208. }
  209. /**
  210. * @test
  211. */
  212. public function setAddressCityForStringSetsAddressCity()
  213. {
  214. $this->subject->setAddressCity('Conceived at T3CON10');
  215. self::assertAttributeEquals(
  216. 'Conceived at T3CON10',
  217. 'addressCity',
  218. $this->subject
  219. );
  220. }
  221. /**
  222. * @test
  223. */
  224. public function getPostalCodeReturnsInitialValueForString()
  225. {
  226. self::assertSame(
  227. '',
  228. $this->subject->getPostalCode()
  229. );
  230. }
  231. /**
  232. * @test
  233. */
  234. public function setPostalCodeForStringSetsPostalCode()
  235. {
  236. $this->subject->setPostalCode('Conceived at T3CON10');
  237. self::assertAttributeEquals(
  238. 'Conceived at T3CON10',
  239. 'postalCode',
  240. $this->subject
  241. );
  242. }
  243. /**
  244. * @test
  245. */
  246. public function getStreetAdressReturnsInitialValueForString()
  247. {
  248. self::assertSame(
  249. '',
  250. $this->subject->getStreetAdress()
  251. );
  252. }
  253. /**
  254. * @test
  255. */
  256. public function setStreetAdressForStringSetsStreetAdress()
  257. {
  258. $this->subject->setStreetAdress('Conceived at T3CON10');
  259. self::assertAttributeEquals(
  260. 'Conceived at T3CON10',
  261. 'streetAdress',
  262. $this->subject
  263. );
  264. }
  265. /**
  266. * @test
  267. */
  268. public function getLatitudeReturnsInitialValueForFloat()
  269. {
  270. self::assertSame(
  271. 0.0,
  272. $this->subject->getLatitude()
  273. );
  274. }
  275. /**
  276. * @test
  277. */
  278. public function setLatitudeForFloatSetsLatitude()
  279. {
  280. $this->subject->setLatitude(3.14159265);
  281. self::assertAttributeEquals(
  282. 3.14159265,
  283. 'latitude',
  284. $this->subject,
  285. '',
  286. 0.000000001
  287. );
  288. }
  289. /**
  290. * @test
  291. */
  292. public function getLongitudeReturnsInitialValueForFloat()
  293. {
  294. self::assertSame(
  295. 0.0,
  296. $this->subject->getLongitude()
  297. );
  298. }
  299. /**
  300. * @test
  301. */
  302. public function setLongitudeForFloatSetsLongitude()
  303. {
  304. $this->subject->setLongitude(3.14159265);
  305. self::assertAttributeEquals(
  306. 3.14159265,
  307. 'longitude',
  308. $this->subject,
  309. '',
  310. 0.000000001
  311. );
  312. }
  313. /**
  314. * @test
  315. */
  316. public function getCountryReturnsInitialValueForString()
  317. {
  318. self::assertSame(
  319. '',
  320. $this->subject->getCountry()
  321. );
  322. }
  323. /**
  324. * @test
  325. */
  326. public function setCountryForStringSetsCountry()
  327. {
  328. $this->subject->setCountry('Conceived at T3CON10');
  329. self::assertAttributeEquals(
  330. 'Conceived at T3CON10',
  331. 'country',
  332. $this->subject
  333. );
  334. }
  335. /**
  336. * @test
  337. */
  338. public function getLogoReturnsInitialValueForString()
  339. {
  340. self::assertSame(
  341. '',
  342. $this->subject->getLogo()
  343. );
  344. }
  345. /**
  346. * @test
  347. */
  348. public function setLogoForStringSetsLogo()
  349. {
  350. $this->subject->setLogo('Conceived at T3CON10');
  351. self::assertAttributeEquals(
  352. 'Conceived at T3CON10',
  353. 'logo',
  354. $this->subject
  355. );
  356. }
  357. /**
  358. * @test
  359. */
  360. public function getParentNameReturnsInitialValueForString()
  361. {
  362. self::assertSame(
  363. '',
  364. $this->subject->getParentName()
  365. );
  366. }
  367. /**
  368. * @test
  369. */
  370. public function setParentNameForStringSetsParentName()
  371. {
  372. $this->subject->setParentName('Conceived at T3CON10');
  373. self::assertAttributeEquals(
  374. 'Conceived at T3CON10',
  375. 'parentName',
  376. $this->subject
  377. );
  378. }
  379. /**
  380. * @test
  381. */
  382. public function getParentSubdomainReturnsInitialValueForString()
  383. {
  384. self::assertSame(
  385. '',
  386. $this->subject->getParentSubdomain()
  387. );
  388. }
  389. /**
  390. * @test
  391. */
  392. public function setParentSubdomainForStringSetsParentSubdomain()
  393. {
  394. $this->subject->setParentSubdomain('Conceived at T3CON10');
  395. self::assertAttributeEquals(
  396. 'Conceived at T3CON10',
  397. 'parentSubdomain',
  398. $this->subject
  399. );
  400. }
  401. }