BirthdayServiceTest.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  6. * @author Georg Ehrke <oc.list@georgehrke.com>
  7. * @author Joas Schilling <coding@schilljs.com>
  8. * @author Roeland Jago Douma <roeland@famdouma.nl>
  9. * @author Thomas Müller <thomas.mueller@tmit.eu>
  10. *
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. namespace OCA\DAV\Tests\unit\CardDAV;
  27. use OCA\DAV\CalDAV\BirthdayService;
  28. use OCA\DAV\CalDAV\CalDavBackend;
  29. use OCA\DAV\CardDAV\CardDavBackend;
  30. use OCA\DAV\DAV\GroupPrincipalBackend;
  31. use OCP\IConfig;
  32. use OCP\IDBConnection;
  33. use OCP\IL10N;
  34. use Sabre\VObject\Component\VCalendar;
  35. use Sabre\VObject\Reader;
  36. use Test\TestCase;
  37. class BirthdayServiceTest extends TestCase {
  38. /** @var BirthdayService */
  39. private $service;
  40. /** @var CalDavBackend | \PHPUnit_Framework_MockObject_MockObject */
  41. private $calDav;
  42. /** @var CardDavBackend | \PHPUnit_Framework_MockObject_MockObject */
  43. private $cardDav;
  44. /** @var GroupPrincipalBackend | \PHPUnit_Framework_MockObject_MockObject */
  45. private $groupPrincipalBackend;
  46. /** @var IConfig | \PHPUnit_Framework_MockObject_MockObject */
  47. private $config;
  48. /** @var IDBConnection | \PHPUnit_Framework_MockObject_MockObject */
  49. private $dbConnection;
  50. /** @var IL10N | \PHPUnit_Framework_MockObject_MockObject */
  51. private $l10n;
  52. protected function setUp(): void {
  53. parent::setUp();
  54. $this->calDav = $this->createMock(CalDavBackend::class);
  55. $this->cardDav = $this->createMock(CardDavBackend::class);
  56. $this->groupPrincipalBackend = $this->createMock(GroupPrincipalBackend::class);
  57. $this->config = $this->createMock(IConfig::class);
  58. $this->dbConnection = $this->createMock(IDBConnection::class);
  59. $this->l10n = $this->createMock(IL10N::class);
  60. $this->l10n->expects($this->any())
  61. ->method('t')
  62. ->willReturnCallback(function ($string, $args) {
  63. return vsprintf($string, $args);
  64. });
  65. $this->service = new BirthdayService($this->calDav,$this->cardDav,
  66. $this->groupPrincipalBackend, $this->config,
  67. $this->dbConnection, $this->l10n);
  68. }
  69. /**
  70. * @dataProvider providesVCards
  71. * @param string $expectedSummary
  72. * @param string $expectedDTStart
  73. * @param string $expectedFieldType
  74. * @param string $expectedUnknownYear
  75. * @param string $expectedOriginalYear
  76. * @param string | null $data
  77. */
  78. public function testBuildBirthdayFromContact($expectedSummary, $expectedDTStart, $expectedFieldType, $expectedUnknownYear, $expectedOriginalYear, $data, $fieldType, $prefix, $supports4Bytes) {
  79. $this->dbConnection->method('supports4ByteText')->willReturn($supports4Bytes);
  80. $cal = $this->service->buildDateFromContact($data, $fieldType, $prefix);
  81. if ($expectedSummary === null) {
  82. $this->assertNull($cal);
  83. } else {
  84. $this->assertInstanceOf('Sabre\VObject\Component\VCalendar', $cal);
  85. $this->assertEquals('-//IDN nextcloud.com//Birthday calendar//EN', $cal->PRODID->getValue());
  86. $this->assertTrue(isset($cal->VEVENT));
  87. $this->assertEquals('FREQ=YEARLY', $cal->VEVENT->RRULE->getValue());
  88. $this->assertEquals($expectedSummary, $cal->VEVENT->SUMMARY->getValue());
  89. $this->assertEquals($expectedDTStart, $cal->VEVENT->DTSTART->getValue());
  90. $this->assertEquals($expectedFieldType, $cal->VEVENT->{'X-NEXTCLOUD-BC-FIELD-TYPE'}->getValue());
  91. $this->assertEquals($expectedUnknownYear, $cal->VEVENT->{'X-NEXTCLOUD-BC-UNKNOWN-YEAR'}->getValue());
  92. if ($expectedOriginalYear) {
  93. $this->assertEquals($expectedOriginalYear, $cal->VEVENT->{'X-NEXTCLOUD-BC-YEAR'}->getValue());
  94. }
  95. $this->assertEquals('TRANSPARENT', $cal->VEVENT->TRANSP->getValue());
  96. }
  97. }
  98. public function testOnCardDeleteGloballyDisabled() {
  99. $this->config->expects($this->once())
  100. ->method('getAppValue')
  101. ->with('dav', 'generateBirthdayCalendar', 'yes')
  102. ->willReturn('no');
  103. $this->cardDav->expects($this->never())->method('getAddressBookById');
  104. $this->service->onCardDeleted(666, 'gump.vcf');
  105. }
  106. public function testOnCardDeleteUserDisabled() {
  107. $this->config->expects($this->once())
  108. ->method('getAppValue')
  109. ->with('dav', 'generateBirthdayCalendar', 'yes')
  110. ->willReturn('yes');
  111. $this->config->expects($this->once())
  112. ->method('getUserValue')
  113. ->with('user01', 'dav', 'generateBirthdayCalendar', 'yes')
  114. ->willReturn('no');
  115. $this->cardDav->expects($this->once())->method('getAddressBookById')
  116. ->with(666)
  117. ->willReturn([
  118. 'principaluri' => 'principals/users/user01',
  119. 'uri' => 'default'
  120. ]);
  121. $this->cardDav->expects($this->once())->method('getShares')->willReturn([]);
  122. $this->calDav->expects($this->never())->method('getCalendarByUri');
  123. $this->calDav->expects($this->never())->method('deleteCalendarObject');
  124. $this->service->onCardDeleted(666, 'gump.vcf');
  125. }
  126. public function testOnCardDeleted() {
  127. $this->config->expects($this->once())
  128. ->method('getAppValue')
  129. ->with('dav', 'generateBirthdayCalendar', 'yes')
  130. ->willReturn('yes');
  131. $this->config->expects($this->once())
  132. ->method('getUserValue')
  133. ->with('user01', 'dav', 'generateBirthdayCalendar', 'yes')
  134. ->willReturn('yes');
  135. $this->cardDav->expects($this->once())->method('getAddressBookById')
  136. ->with(666)
  137. ->willReturn([
  138. 'principaluri' => 'principals/users/user01',
  139. 'uri' => 'default'
  140. ]);
  141. $this->calDav->expects($this->once())->method('getCalendarByUri')
  142. ->with('principals/users/user01', 'contact_birthdays')
  143. ->willReturn([
  144. 'id' => 1234
  145. ]);
  146. $this->calDav->expects($this->at(1))->method('deleteCalendarObject')->with(1234, 'default-gump.vcf.ics');
  147. $this->calDav->expects($this->at(2))->method('deleteCalendarObject')->with(1234, 'default-gump.vcf-death.ics');
  148. $this->calDav->expects($this->at(3))->method('deleteCalendarObject')->with(1234, 'default-gump.vcf-anniversary.ics');
  149. $this->cardDav->expects($this->once())->method('getShares')->willReturn([]);
  150. $this->service->onCardDeleted(666, 'gump.vcf');
  151. }
  152. public function testOnCardChangedGloballyDisabled() {
  153. $this->config->expects($this->once())
  154. ->method('getAppValue')
  155. ->with('dav', 'generateBirthdayCalendar', 'yes')
  156. ->willReturn('no');
  157. $this->cardDav->expects($this->never())->method('getAddressBookById');
  158. $service = $this->getMockBuilder(BirthdayService::class)
  159. ->setMethods(['buildDateFromContact', 'birthdayEvenChanged'])
  160. ->setConstructorArgs([$this->calDav, $this->cardDav, $this->groupPrincipalBackend, $this->config, $this->dbConnection, $this->l10n])
  161. ->getMock();
  162. $service->onCardChanged(666, 'gump.vcf', '');
  163. }
  164. public function testOnCardChangedUserDisabled() {
  165. $this->config->expects($this->once())
  166. ->method('getAppValue')
  167. ->with('dav', 'generateBirthdayCalendar', 'yes')
  168. ->willReturn('yes');
  169. $this->config->expects($this->once())
  170. ->method('getUserValue')
  171. ->with('user01', 'dav', 'generateBirthdayCalendar', 'yes')
  172. ->willReturn('no');
  173. $this->cardDav->expects($this->once())->method('getAddressBookById')
  174. ->with(666)
  175. ->willReturn([
  176. 'principaluri' => 'principals/users/user01',
  177. 'uri' => 'default'
  178. ]);
  179. $this->cardDav->expects($this->once())->method('getShares')->willReturn([]);
  180. $this->calDav->expects($this->never())->method('getCalendarByUri');
  181. /** @var BirthdayService | \PHPUnit_Framework_MockObject_MockObject $service */
  182. $service = $this->getMockBuilder(BirthdayService::class)
  183. ->setMethods(['buildDateFromContact', 'birthdayEvenChanged'])
  184. ->setConstructorArgs([$this->calDav, $this->cardDav, $this->groupPrincipalBackend, $this->config, $this->dbConnection, $this->l10n])
  185. ->getMock();
  186. $service->onCardChanged(666, 'gump.vcf', '');
  187. }
  188. /**
  189. * @dataProvider providesCardChanges
  190. */
  191. public function testOnCardChanged($expectedOp) {
  192. $this->config->expects($this->once())
  193. ->method('getAppValue')
  194. ->with('dav', 'generateBirthdayCalendar', 'yes')
  195. ->willReturn('yes');
  196. $this->config->expects($this->once())
  197. ->method('getUserValue')
  198. ->with('user01', 'dav', 'generateBirthdayCalendar', 'yes')
  199. ->willReturn('yes');
  200. $this->cardDav->expects($this->once())->method('getAddressBookById')
  201. ->with(666)
  202. ->willReturn([
  203. 'principaluri' => 'principals/users/user01',
  204. 'uri' => 'default'
  205. ]);
  206. $this->calDav->expects($this->once())->method('getCalendarByUri')
  207. ->with('principals/users/user01', 'contact_birthdays')
  208. ->willReturn([
  209. 'id' => 1234
  210. ]);
  211. $this->cardDav->expects($this->once())->method('getShares')->willReturn([]);
  212. /** @var BirthdayService | \PHPUnit_Framework_MockObject_MockObject $service */
  213. $service = $this->getMockBuilder(BirthdayService::class)
  214. ->setMethods(['buildDateFromContact', 'birthdayEvenChanged'])
  215. ->setConstructorArgs([$this->calDav, $this->cardDav, $this->groupPrincipalBackend, $this->config, $this->dbConnection, $this->l10n])
  216. ->getMock();
  217. if ($expectedOp === 'delete') {
  218. $this->calDav->expects($this->exactly(3))->method('getCalendarObject')->willReturn('');
  219. $service->expects($this->exactly(3))->method('buildDateFromContact')->willReturn(null);
  220. $this->calDav->expects($this->exactly(3))->method('deleteCalendarObject')->withConsecutive(
  221. [1234, 'default-gump.vcf.ics'],
  222. [1234, 'default-gump.vcf-death.ics'],
  223. [1234, 'default-gump.vcf-anniversary.ics']
  224. );
  225. }
  226. if ($expectedOp === 'create') {
  227. $vCal = new VCalendar();
  228. $vCal->PRODID = '-//Nextcloud testing//mocked object//';
  229. $service->expects($this->exactly(3))->method('buildDateFromContact')->willReturn($vCal);
  230. $this->calDav->expects($this->exactly(3))->method('createCalendarObject')->withConsecutive(
  231. [1234, 'default-gump.vcf.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"],
  232. [1234, 'default-gump.vcf-death.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"],
  233. [1234, 'default-gump.vcf-anniversary.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"]
  234. );
  235. }
  236. if ($expectedOp === 'update') {
  237. $vCal = new VCalendar();
  238. $vCal->PRODID = '-//Nextcloud testing//mocked object//';
  239. $service->expects($this->exactly(3))->method('buildDateFromContact')->willReturn($vCal);
  240. $service->expects($this->exactly(3))->method('birthdayEvenChanged')->willReturn(true);
  241. $this->calDav->expects($this->exactly(3))->method('getCalendarObject')->willReturn(['calendardata' => '']);
  242. $this->calDav->expects($this->exactly(3))->method('updateCalendarObject')->withConsecutive(
  243. [1234, 'default-gump.vcf.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"],
  244. [1234, 'default-gump.vcf-death.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"],
  245. [1234, 'default-gump.vcf-anniversary.ics', "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nCALSCALE:GREGORIAN\r\nPRODID:-//Nextcloud testing//mocked object//\r\nEND:VCALENDAR\r\n"]
  246. );
  247. }
  248. $service->onCardChanged(666, 'gump.vcf', '');
  249. }
  250. /**
  251. * @dataProvider providesBirthday
  252. * @param $expected
  253. * @param $old
  254. * @param $new
  255. */
  256. public function testBirthdayEvenChanged($expected, $old, $new) {
  257. $new = Reader::read($new);
  258. $this->assertEquals($expected, $this->service->birthdayEvenChanged($old, $new));
  259. }
  260. public function testGetAllAffectedPrincipals() {
  261. $this->cardDav->expects($this->once())->method('getShares')->willReturn([
  262. [
  263. '{http://owncloud.org/ns}group-share' => false,
  264. '{http://owncloud.org/ns}principal' => 'principals/users/user01'
  265. ],
  266. [
  267. '{http://owncloud.org/ns}group-share' => false,
  268. '{http://owncloud.org/ns}principal' => 'principals/users/user01'
  269. ],
  270. [
  271. '{http://owncloud.org/ns}group-share' => false,
  272. '{http://owncloud.org/ns}principal' => 'principals/users/user02'
  273. ],
  274. [
  275. '{http://owncloud.org/ns}group-share' => true,
  276. '{http://owncloud.org/ns}principal' => 'principals/groups/users'
  277. ],
  278. ]);
  279. $this->groupPrincipalBackend->expects($this->once())->method('getGroupMemberSet')
  280. ->willReturn([
  281. [
  282. 'uri' => 'principals/users/user01',
  283. ],
  284. [
  285. 'uri' => 'principals/users/user02',
  286. ],
  287. [
  288. 'uri' => 'principals/users/user03',
  289. ],
  290. ]);
  291. $users = $this->invokePrivate($this->service, 'getAllAffectedPrincipals', [6666]);
  292. $this->assertEquals([
  293. 'principals/users/user01',
  294. 'principals/users/user02',
  295. 'principals/users/user03'
  296. ], $users);
  297. }
  298. public function testBirthdayCalendarHasComponentEvent() {
  299. $this->calDav->expects($this->once())
  300. ->method('createCalendar')
  301. ->with('principal001', 'contact_birthdays', [
  302. '{DAV:}displayname' => 'Contact birthdays',
  303. '{http://apple.com/ns/ical/}calendar-color' => '#FFFFCA',
  304. 'components' => 'VEVENT',
  305. ]);
  306. $this->service->ensureCalendarExists('principal001');
  307. }
  308. public function testResetForUser() {
  309. $this->calDav->expects($this->at(0))
  310. ->method('getCalendarByUri')
  311. ->with('principals/users/user123', 'contact_birthdays')
  312. ->willReturn(['id' => 42]);
  313. $this->calDav->expects($this->at(1))
  314. ->method('getCalendarObjects')
  315. ->with(42, 0)
  316. ->willReturn([['uri' => '1.ics'], ['uri' => '2.ics'], ['uri' => '3.ics']]);
  317. $this->calDav->expects($this->at(2))
  318. ->method('deleteCalendarObject')
  319. ->with(42, '1.ics', 0);
  320. $this->calDav->expects($this->at(3))
  321. ->method('deleteCalendarObject')
  322. ->with(42, '2.ics', 0);
  323. $this->calDav->expects($this->at(4))
  324. ->method('deleteCalendarObject')
  325. ->with(42, '3.ics', 0);
  326. $this->service->resetForUser('user123');
  327. }
  328. public function providesBirthday() {
  329. return [
  330. [true,
  331. '',
  332. "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nCALSCALE:GREGORIAN\r\nBEGIN:VEVENT\r\nUID:12345\r\nDTSTAMP:20160218T133704Z\r\nDTSTART;VALUE=DATE:19000101\r\nDTEND;VALUE=DATE:19000102\r\nRRULE:FREQ=YEARLY\r\nSUMMARY:12345's Birthday (1900)\r\nTRANSP:TRANSPARENT\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n"],
  333. [false,
  334. "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nCALSCALE:GREGORIAN\r\nBEGIN:VEVENT\r\nUID:12345\r\nDTSTAMP:20160218T133704Z\r\nDTSTART;VALUE=DATE:19000101\r\nDTEND;VALUE=DATE:19000102\r\nRRULE:FREQ=YEARLY\r\nSUMMARY:12345's Birthday (1900)\r\nTRANSP:TRANSPARENT\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n",
  335. "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nCALSCALE:GREGORIAN\r\nBEGIN:VEVENT\r\nUID:12345\r\nDTSTAMP:20160218T133704Z\r\nDTSTART;VALUE=DATE:19000101\r\nDTEND;VALUE=DATE:19000102\r\nRRULE:FREQ=YEARLY\r\nSUMMARY:12345's Birthday (1900)\r\nTRANSP:TRANSPARENT\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n"],
  336. [true,
  337. "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nCALSCALE:GREGORIAN\r\nBEGIN:VEVENT\r\nUID:12345\r\nDTSTAMP:20160218T133704Z\r\nDTSTART;VALUE=DATE:19000101\r\nDTEND;VALUE=DATE:19000102\r\nRRULE:FREQ=YEARLY\r\nSUMMARY:4567's Birthday (1900)\r\nTRANSP:TRANSPARENT\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n",
  338. "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nCALSCALE:GREGORIAN\r\nBEGIN:VEVENT\r\nUID:12345\r\nDTSTAMP:20160218T133704Z\r\nDTSTART;VALUE=DATE:19000101\r\nDTEND;VALUE=DATE:19000102\r\nRRULE:FREQ=YEARLY\r\nSUMMARY:12345's Birthday (1900)\r\nTRANSP:TRANSPARENT\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n"],
  339. [true,
  340. "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nCALSCALE:GREGORIAN\r\nBEGIN:VEVENT\r\nUID:12345\r\nDTSTAMP:20160218T133704Z\r\nDTSTART;VALUE=DATE:19000101\r\nDTEND;VALUE=DATE:19000102\r\nRRULE:FREQ=YEARLY\r\nSUMMARY:12345's Birthday (1900)\r\nTRANSP:TRANSPARENT\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n",
  341. "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nCALSCALE:GREGORIAN\r\nBEGIN:VEVENT\r\nUID:12345\r\nDTSTAMP:20160218T133704Z\r\nDTSTART;VALUE=DATE:19000102\r\nDTEND;VALUE=DATE:19000102\r\nRRULE:FREQ=YEARLY\r\nSUMMARY:12345's Birthday (1900)\r\nTRANSP:TRANSPARENT\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n"]
  342. ];
  343. }
  344. public function providesCardChanges() {
  345. return[
  346. ['delete'],
  347. ['create'],
  348. ['update']
  349. ];
  350. }
  351. public function providesVCards() {
  352. return [
  353. // $expectedSummary, $expectedDTStart, $expectedFieldType, $expectedUnknownYear, $expectedOriginalYear, $data, $fieldType, $prefix, $supports4Byte
  354. [null, null, null, null, null, 'yasfewf', '', '', true],
  355. [null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nEND:VCARD\r\n", 'BDAY', '', true],
  356. [null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:\r\nEND:VCARD\r\n", 'BDAY', '', true],
  357. [null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:someday\r\nEND:VCARD\r\n", 'BDAY', '', true],
  358. ['🎂 12345 (1900)', '19700101', 'BDAY', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:19000101\r\nEND:VCARD\r\n", 'BDAY', '', true],
  359. ['🎂 12345 (1900)', '19701231', 'BDAY', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:19001231\r\nEND:VCARD\r\n", 'BDAY', '', true],
  360. ['Death of 12345 (1900)', '19701231', 'DEATHDATE', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nDEATHDATE:19001231\r\nEND:VCARD\r\n", 'DEATHDATE', '-death', true],
  361. ['Death of 12345 (1900)', '19701231', 'DEATHDATE', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nDEATHDATE:19001231\r\nEND:VCARD\r\n", 'DEATHDATE', '-death', false],
  362. ['💍 12345 (1900)', '19701231', 'ANNIVERSARY', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nANNIVERSARY:19001231\r\nEND:VCARD\r\n", 'ANNIVERSARY', '-anniversary', true],
  363. ['12345 (⚭1900)', '19701231', 'ANNIVERSARY', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nANNIVERSARY:19001231\r\nEND:VCARD\r\n", 'ANNIVERSARY', '-anniversary', false],
  364. ['🎂 12345', '19701231', 'BDAY', '1', null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:--1231\r\nEND:VCARD\r\n", 'BDAY', '', true],
  365. ['🎂 12345', '19701231', 'BDAY', '1', null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY;X-APPLE-OMIT-YEAR=1604:16041231\r\nEND:VCARD\r\n", 'BDAY', '', true],
  366. [null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:;VALUE=text:circa 1800\r\nEND:VCARD\r\n", 'BDAY', '', true],
  367. [null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nN:12345;;;;\r\nBDAY:20031231\r\nEND:VCARD\r\n", 'BDAY', '', true],
  368. ['🎂 12345 (900)', '19701231', 'BDAY', '0', '900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:09001231\r\nEND:VCARD\r\n", 'BDAY', '', true],
  369. ['12345 (*1900)', '19700101', 'BDAY', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:19000101\r\nEND:VCARD\r\n", 'BDAY', '', false],
  370. ['12345 (*1900)', '19701231', 'BDAY', '0', '1900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:19001231\r\nEND:VCARD\r\n", 'BDAY', '', false],
  371. ['12345 *', '19701231', 'BDAY', '1', null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:--1231\r\nEND:VCARD\r\n", 'BDAY', '', false],
  372. ['12345 *', '19701231', 'BDAY', '1', null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY;X-APPLE-OMIT-YEAR=1604:16041231\r\nEND:VCARD\r\n", 'BDAY', '', false],
  373. [null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:;VALUE=text:circa 1800\r\nEND:VCARD\r\n", 'BDAY', '', false],
  374. [null, null, null, null, null, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nN:12345;;;;\r\nBDAY:20031231\r\nEND:VCARD\r\n", 'BDAY', '', false],
  375. ['12345 (*900)', '19701231', 'BDAY', '0', '900', "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 4.1.1//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nBDAY:09001231\r\nEND:VCARD\r\n", 'BDAY', '', false],
  376. ];
  377. }
  378. }