EventTest.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898
  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 EventTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
  9. {
  10. /**
  11. * @var \Opentalent\OtWidgets\Domain\Model\Event
  12. */
  13. protected $subject = null;
  14. protected function setUp()
  15. {
  16. parent::setUp();
  17. $this->subject = new \Opentalent\OtWidgets\Domain\Model\Event();
  18. }
  19. protected function tearDown()
  20. {
  21. parent::tearDown();
  22. }
  23. /**
  24. * @test
  25. */
  26. public function getIdReturnsInitialValueForInt()
  27. {
  28. self::assertSame(
  29. 0,
  30. $this->subject->getId()
  31. );
  32. }
  33. /**
  34. * @test
  35. */
  36. public function setIdForIntSetsId()
  37. {
  38. $this->subject->setId(12);
  39. self::assertAttributeEquals(
  40. 12,
  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 getOrganizationIdReturnsInitialValueForInt()
  71. {
  72. self::assertSame(
  73. 0,
  74. $this->subject->getOrganizationId()
  75. );
  76. }
  77. /**
  78. * @test
  79. */
  80. public function setOrganizationIdForIntSetsOrganizationId()
  81. {
  82. $this->subject->setOrganizationId(12);
  83. self::assertAttributeEquals(
  84. 12,
  85. 'organizationId',
  86. $this->subject
  87. );
  88. }
  89. /**
  90. * @test
  91. */
  92. public function getSubdomainReturnsInitialValueForString()
  93. {
  94. self::assertSame(
  95. '',
  96. $this->subject->getSubdomain()
  97. );
  98. }
  99. /**
  100. * @test
  101. */
  102. public function setSubdomainForStringSetsSubdomain()
  103. {
  104. $this->subject->setSubdomain('Conceived at T3CON10');
  105. self::assertAttributeEquals(
  106. 'Conceived at T3CON10',
  107. 'subdomain',
  108. $this->subject
  109. );
  110. }
  111. /**
  112. * @test
  113. */
  114. public function getNameReturnsInitialValueForString()
  115. {
  116. self::assertSame(
  117. '',
  118. $this->subject->getName()
  119. );
  120. }
  121. /**
  122. * @test
  123. */
  124. public function setNameForStringSetsName()
  125. {
  126. $this->subject->setName('Conceived at T3CON10');
  127. self::assertAttributeEquals(
  128. 'Conceived at T3CON10',
  129. 'name',
  130. $this->subject
  131. );
  132. }
  133. /**
  134. * @test
  135. */
  136. public function getDescriptionReturnsInitialValueForString()
  137. {
  138. self::assertSame(
  139. '',
  140. $this->subject->getDescription()
  141. );
  142. }
  143. /**
  144. * @test
  145. */
  146. public function setDescriptionForStringSetsDescription()
  147. {
  148. $this->subject->setDescription('Conceived at T3CON10');
  149. self::assertAttributeEquals(
  150. 'Conceived at T3CON10',
  151. 'description',
  152. $this->subject
  153. );
  154. }
  155. /**
  156. * @test
  157. */
  158. public function getCategoriesReturnsInitialValueForInt()
  159. {
  160. self::assertSame(
  161. 0,
  162. $this->subject->getCategories()
  163. );
  164. }
  165. /**
  166. * @test
  167. */
  168. public function setCategoriesForIntSetsCategories()
  169. {
  170. $this->subject->setCategories(12);
  171. self::assertAttributeEquals(
  172. 12,
  173. 'categories',
  174. $this->subject
  175. );
  176. }
  177. /**
  178. * @test
  179. */
  180. public function getUrlReturnsInitialValueForString()
  181. {
  182. self::assertSame(
  183. '',
  184. $this->subject->getUrl()
  185. );
  186. }
  187. /**
  188. * @test
  189. */
  190. public function setUrlForStringSetsUrl()
  191. {
  192. $this->subject->setUrl('Conceived at T3CON10');
  193. self::assertAttributeEquals(
  194. 'Conceived at T3CON10',
  195. 'url',
  196. $this->subject
  197. );
  198. }
  199. /**
  200. * @test
  201. */
  202. public function getRuleReturnsInitialValueForString()
  203. {
  204. self::assertSame(
  205. '',
  206. $this->subject->getRule()
  207. );
  208. }
  209. /**
  210. * @test
  211. */
  212. public function setRuleForStringSetsRule()
  213. {
  214. $this->subject->setRule('Conceived at T3CON10');
  215. self::assertAttributeEquals(
  216. 'Conceived at T3CON10',
  217. 'rule',
  218. $this->subject
  219. );
  220. }
  221. /**
  222. * @test
  223. */
  224. public function getDatetimeStartReturnsInitialValueForDateTime()
  225. {
  226. self::assertEquals(
  227. null,
  228. $this->subject->getDatetimeStart()
  229. );
  230. }
  231. /**
  232. * @test
  233. */
  234. public function setDatetimeStartForDateTimeSetsDatetimeStart()
  235. {
  236. $dateTimeFixture = new \DateTime();
  237. $this->subject->setDatetimeStart($dateTimeFixture);
  238. self::assertAttributeEquals(
  239. $dateTimeFixture,
  240. 'datetimeStart',
  241. $this->subject
  242. );
  243. }
  244. /**
  245. * @test
  246. */
  247. public function getDatetimeEndReturnsInitialValueForDateTime()
  248. {
  249. self::assertEquals(
  250. null,
  251. $this->subject->getDatetimeEnd()
  252. );
  253. }
  254. /**
  255. * @test
  256. */
  257. public function setDatetimeEndForDateTimeSetsDatetimeEnd()
  258. {
  259. $dateTimeFixture = new \DateTime();
  260. $this->subject->setDatetimeEnd($dateTimeFixture);
  261. self::assertAttributeEquals(
  262. $dateTimeFixture,
  263. 'datetimeEnd',
  264. $this->subject
  265. );
  266. }
  267. /**
  268. * @test
  269. */
  270. public function getDatesReturnsInitialValueForString()
  271. {
  272. self::assertSame(
  273. '',
  274. $this->subject->getDates()
  275. );
  276. }
  277. /**
  278. * @test
  279. */
  280. public function setDatesForStringSetsDates()
  281. {
  282. $this->subject->setDates('Conceived at T3CON10');
  283. self::assertAttributeEquals(
  284. 'Conceived at T3CON10',
  285. 'dates',
  286. $this->subject
  287. );
  288. }
  289. /**
  290. * @test
  291. */
  292. public function getPlacenameReturnsInitialValueForString()
  293. {
  294. self::assertSame(
  295. '',
  296. $this->subject->getPlacename()
  297. );
  298. }
  299. /**
  300. * @test
  301. */
  302. public function setPlacenameForStringSetsPlacename()
  303. {
  304. $this->subject->setPlacename('Conceived at T3CON10');
  305. self::assertAttributeEquals(
  306. 'Conceived at T3CON10',
  307. 'placename',
  308. $this->subject
  309. );
  310. }
  311. /**
  312. * @test
  313. */
  314. public function getPlaceDescriptionReturnsInitialValueForString()
  315. {
  316. self::assertSame(
  317. '',
  318. $this->subject->getPlaceDescription()
  319. );
  320. }
  321. /**
  322. * @test
  323. */
  324. public function setPlaceDescriptionForStringSetsPlaceDescription()
  325. {
  326. $this->subject->setPlaceDescription('Conceived at T3CON10');
  327. self::assertAttributeEquals(
  328. 'Conceived at T3CON10',
  329. 'placeDescription',
  330. $this->subject
  331. );
  332. }
  333. /**
  334. * @test
  335. */
  336. public function getPlaceFloorSizeReturnsInitialValueForString()
  337. {
  338. self::assertSame(
  339. '',
  340. $this->subject->getPlaceFloorSize()
  341. );
  342. }
  343. /**
  344. * @test
  345. */
  346. public function setPlaceFloorSizeForStringSetsPlaceFloorSize()
  347. {
  348. $this->subject->setPlaceFloorSize('Conceived at T3CON10');
  349. self::assertAttributeEquals(
  350. 'Conceived at T3CON10',
  351. 'placeFloorSize',
  352. $this->subject
  353. );
  354. }
  355. /**
  356. * @test
  357. */
  358. public function getPlaceCapacityReturnsInitialValueForString()
  359. {
  360. self::assertSame(
  361. '',
  362. $this->subject->getPlaceCapacity()
  363. );
  364. }
  365. /**
  366. * @test
  367. */
  368. public function setPlaceCapacityForStringSetsPlaceCapacity()
  369. {
  370. $this->subject->setPlaceCapacity('Conceived at T3CON10');
  371. self::assertAttributeEquals(
  372. 'Conceived at T3CON10',
  373. 'placeCapacity',
  374. $this->subject
  375. );
  376. }
  377. /**
  378. * @test
  379. */
  380. public function getCityReturnsInitialValueForString()
  381. {
  382. self::assertSame(
  383. '',
  384. $this->subject->getCity()
  385. );
  386. }
  387. /**
  388. * @test
  389. */
  390. public function setCityForStringSetsCity()
  391. {
  392. $this->subject->setCity('Conceived at T3CON10');
  393. self::assertAttributeEquals(
  394. 'Conceived at T3CON10',
  395. 'city',
  396. $this->subject
  397. );
  398. }
  399. /**
  400. * @test
  401. */
  402. public function getPostalCodeReturnsInitialValueForString()
  403. {
  404. self::assertSame(
  405. '',
  406. $this->subject->getPostalCode()
  407. );
  408. }
  409. /**
  410. * @test
  411. */
  412. public function setPostalCodeForStringSetsPostalCode()
  413. {
  414. $this->subject->setPostalCode('Conceived at T3CON10');
  415. self::assertAttributeEquals(
  416. 'Conceived at T3CON10',
  417. 'postalCode',
  418. $this->subject
  419. );
  420. }
  421. /**
  422. * @test
  423. */
  424. public function getStreetAddressReturnsInitialValueForString()
  425. {
  426. self::assertSame(
  427. '',
  428. $this->subject->getStreetAddress()
  429. );
  430. }
  431. /**
  432. * @test
  433. */
  434. public function setStreetAddressForStringSetsStreetAddress()
  435. {
  436. $this->subject->setStreetAddress('Conceived at T3CON10');
  437. self::assertAttributeEquals(
  438. 'Conceived at T3CON10',
  439. 'streetAddress',
  440. $this->subject
  441. );
  442. }
  443. /**
  444. * @test
  445. */
  446. public function getLongitudeReturnsInitialValueForFloat()
  447. {
  448. self::assertSame(
  449. 0.0,
  450. $this->subject->getLongitude()
  451. );
  452. }
  453. /**
  454. * @test
  455. */
  456. public function setLongitudeForFloatSetsLongitude()
  457. {
  458. $this->subject->setLongitude(3.14159265);
  459. self::assertAttributeEquals(
  460. 3.14159265,
  461. 'longitude',
  462. $this->subject,
  463. '',
  464. 0.000000001
  465. );
  466. }
  467. /**
  468. * @test
  469. */
  470. public function getLatitudeReturnsInitialValueForFloat()
  471. {
  472. self::assertSame(
  473. 0.0,
  474. $this->subject->getLatitude()
  475. );
  476. }
  477. /**
  478. * @test
  479. */
  480. public function setLatitudeForFloatSetsLatitude()
  481. {
  482. $this->subject->setLatitude(3.14159265);
  483. self::assertAttributeEquals(
  484. 3.14159265,
  485. 'latitude',
  486. $this->subject,
  487. '',
  488. 0.000000001
  489. );
  490. }
  491. /**
  492. * @test
  493. */
  494. public function getRoomNameReturnsInitialValueForString()
  495. {
  496. self::assertSame(
  497. '',
  498. $this->subject->getRoomName()
  499. );
  500. }
  501. /**
  502. * @test
  503. */
  504. public function setRoomNameForStringSetsRoomName()
  505. {
  506. $this->subject->setRoomName('Conceived at T3CON10');
  507. self::assertAttributeEquals(
  508. 'Conceived at T3CON10',
  509. 'roomName',
  510. $this->subject
  511. );
  512. }
  513. /**
  514. * @test
  515. */
  516. public function getRoomDescriptionReturnsInitialValueForString()
  517. {
  518. self::assertSame(
  519. '',
  520. $this->subject->getRoomDescription()
  521. );
  522. }
  523. /**
  524. * @test
  525. */
  526. public function setRoomDescriptionForStringSetsRoomDescription()
  527. {
  528. $this->subject->setRoomDescription('Conceived at T3CON10');
  529. self::assertAttributeEquals(
  530. 'Conceived at T3CON10',
  531. 'roomDescription',
  532. $this->subject
  533. );
  534. }
  535. /**
  536. * @test
  537. */
  538. public function getRoomLocalisationReturnsInitialValueForString()
  539. {
  540. self::assertSame(
  541. '',
  542. $this->subject->getRoomLocalisation()
  543. );
  544. }
  545. /**
  546. * @test
  547. */
  548. public function setRoomLocalisationForStringSetsRoomLocalisation()
  549. {
  550. $this->subject->setRoomLocalisation('Conceived at T3CON10');
  551. self::assertAttributeEquals(
  552. 'Conceived at T3CON10',
  553. 'roomLocalisation',
  554. $this->subject
  555. );
  556. }
  557. /**
  558. * @test
  559. */
  560. public function getRoomCapacityReturnsInitialValueForString()
  561. {
  562. self::assertSame(
  563. '',
  564. $this->subject->getRoomCapacity()
  565. );
  566. }
  567. /**
  568. * @test
  569. */
  570. public function setRoomCapacityForStringSetsRoomCapacity()
  571. {
  572. $this->subject->setRoomCapacity('Conceived at T3CON10');
  573. self::assertAttributeEquals(
  574. 'Conceived at T3CON10',
  575. 'roomCapacity',
  576. $this->subject
  577. );
  578. }
  579. /**
  580. * @test
  581. */
  582. public function getRoomFloorSizeReturnsInitialValueForString()
  583. {
  584. self::assertSame(
  585. '',
  586. $this->subject->getRoomFloorSize()
  587. );
  588. }
  589. /**
  590. * @test
  591. */
  592. public function setRoomFloorSizeForStringSetsRoomFloorSize()
  593. {
  594. $this->subject->setRoomFloorSize('Conceived at T3CON10');
  595. self::assertAttributeEquals(
  596. 'Conceived at T3CON10',
  597. 'roomFloorSize',
  598. $this->subject
  599. );
  600. }
  601. /**
  602. * @test
  603. */
  604. public function getZupIdReturnsInitialValueForInt()
  605. {
  606. self::assertSame(
  607. 0,
  608. $this->subject->getZupId()
  609. );
  610. }
  611. /**
  612. * @test
  613. */
  614. public function setZupIdForIntSetsZupId()
  615. {
  616. $this->subject->setZupId(12);
  617. self::assertAttributeEquals(
  618. 12,
  619. 'zupId',
  620. $this->subject
  621. );
  622. }
  623. /**
  624. * @test
  625. */
  626. public function getDeepLinkReturnsInitialValueForString()
  627. {
  628. self::assertSame(
  629. '',
  630. $this->subject->getDeepLink()
  631. );
  632. }
  633. /**
  634. * @test
  635. */
  636. public function setDeepLinkForStringSetsDeepLink()
  637. {
  638. $this->subject->setDeepLink('Conceived at T3CON10');
  639. self::assertAttributeEquals(
  640. 'Conceived at T3CON10',
  641. 'deepLink',
  642. $this->subject
  643. );
  644. }
  645. /**
  646. * @test
  647. */
  648. public function getImageReturnsInitialValueForString()
  649. {
  650. self::assertSame(
  651. '',
  652. $this->subject->getImage()
  653. );
  654. }
  655. /**
  656. * @test
  657. */
  658. public function setImageForStringSetsImage()
  659. {
  660. $this->subject->setImage('Conceived at T3CON10');
  661. self::assertAttributeEquals(
  662. 'Conceived at T3CON10',
  663. 'image',
  664. $this->subject
  665. );
  666. }
  667. /**
  668. * @test
  669. */
  670. public function getPriceMiniReturnsInitialValueForFloat()
  671. {
  672. self::assertSame(
  673. 0.0,
  674. $this->subject->getPriceMini()
  675. );
  676. }
  677. /**
  678. * @test
  679. */
  680. public function setPriceMiniForFloatSetsPriceMini()
  681. {
  682. $this->subject->setPriceMini(3.14159265);
  683. self::assertAttributeEquals(
  684. 3.14159265,
  685. 'priceMini',
  686. $this->subject,
  687. '',
  688. 0.000000001
  689. );
  690. }
  691. /**
  692. * @test
  693. */
  694. public function getMeetingScheduleReturnsInitialValueForString()
  695. {
  696. self::assertSame(
  697. '',
  698. $this->subject->getMeetingSchedule()
  699. );
  700. }
  701. /**
  702. * @test
  703. */
  704. public function setMeetingScheduleForStringSetsMeetingSchedule()
  705. {
  706. $this->subject->setMeetingSchedule('Conceived at T3CON10');
  707. self::assertAttributeEquals(
  708. 'Conceived at T3CON10',
  709. 'meetingSchedule',
  710. $this->subject
  711. );
  712. }
  713. /**
  714. * @test
  715. */
  716. public function getApiReturnsInitialValueForBool()
  717. {
  718. self::assertSame(
  719. false,
  720. $this->subject->getApi()
  721. );
  722. }
  723. /**
  724. * @test
  725. */
  726. public function setApiForBoolSetsApi()
  727. {
  728. $this->subject->setApi(true);
  729. self::assertAttributeEquals(
  730. true,
  731. 'api',
  732. $this->subject
  733. );
  734. }
  735. /**
  736. * @test
  737. */
  738. public function getParentNameReturnsInitialValueForString()
  739. {
  740. self::assertSame(
  741. '',
  742. $this->subject->getParentName()
  743. );
  744. }
  745. /**
  746. * @test
  747. */
  748. public function setParentNameForStringSetsParentName()
  749. {
  750. $this->subject->setParentName('Conceived at T3CON10');
  751. self::assertAttributeEquals(
  752. 'Conceived at T3CON10',
  753. 'parentName',
  754. $this->subject
  755. );
  756. }
  757. /**
  758. * @test
  759. */
  760. public function getParentSubdomainReturnsInitialValueForString()
  761. {
  762. self::assertSame(
  763. '',
  764. $this->subject->getParentSubdomain()
  765. );
  766. }
  767. /**
  768. * @test
  769. */
  770. public function setParentSubdomainForStringSetsParentSubdomain()
  771. {
  772. $this->subject->setParentSubdomain('Conceived at T3CON10');
  773. self::assertAttributeEquals(
  774. 'Conceived at T3CON10',
  775. 'parentSubdomain',
  776. $this->subject
  777. );
  778. }
  779. /**
  780. * @test
  781. */
  782. public function getOrganizationReturnsInitialValueFor()
  783. {
  784. }
  785. /**
  786. * @test
  787. */
  788. public function setOrganizationForSetsOrganization()
  789. {
  790. }
  791. }