signin(); $contact = factory(Contact::class)->create([ 'account_id' => $user->account_id, ]); $specialDate = $contact->setSpecialDate('birthdate', 1983, 03, 04); $specialDate->uuid = Str::uuid(); $specialDate->save(); $response = $this->get("/dav/calendars/{$user->email}/birthdays/{$specialDate->uuid}.ics"); $response->assertStatus(200); $response->assertHeader('X-Sabre-Version'); $this->assertVObjectEqualsVObject($this->getCal($specialDate, true), $response->getContent() ?: $response->streamedContent()); } public function test_caldav_birthdays_report() { $user = $this->signin(); $contact = factory(Contact::class)->create([ 'account_id' => $user->account_id, ]); $specialDate = $contact->setSpecialDate('birthdate', 1983, 03, 04); $specialDate->uuid = Str::uuid(); $specialDate->save(); $response = $this->call('REPORT', "/dav/calendars/{$user->email}/birthdays/", [], [], [], [ 'HTTP_DEPTH' => '1', 'content-type' => 'application/xml; charset=utf-8', ], ' ' ); $response->assertStatus(207); $response->assertHeader('X-Sabre-Version'); $response->assertSee(''. ''. "/dav/calendars/{$user->email}/birthdays/{$specialDate->uuid}.ics". ''. ''. ""{$this->getEtag($specialDate)}"". "{$this->getCal($specialDate)}". ''. 'HTTP/1.1 200 OK'. ''. ''. '', false); } public function test_caldav_birthdays_report_multiget() { $user = $this->signin(); $contact1 = factory(Contact::class)->create([ 'account_id' => $user->account_id, ]); $specialDate1 = $contact1->setSpecialDate('birthdate', 1983, 03, 04); $specialDate1->uuid = Str::uuid(); $specialDate1->save(); $contact2 = factory(Contact::class)->create([ 'account_id' => $user->account_id, 'firstname' => 'Jane', ]); $specialDate2 = $contact2->setSpecialDate('birthdate', 1980, 05, 01); $specialDate2->uuid = Str::uuid(); $specialDate2->save(); $response = $this->call('REPORT', "/dav/calendars/{$user->email}/birthdays/", [], [], [], [ 'HTTP_DEPTH' => '1', ], " /dav/calendars/{$user->email}/birthdays/{$specialDate1->uuid}.ics /dav/calendars/{$user->email}/birthdays/{$specialDate2->uuid}.ics " ); $response->assertStatus(207); $response->assertHeader('X-Sabre-Version'); $response->assertSee(''. ''. "/dav/calendars/{$user->email}/birthdays/{$specialDate1->uuid}.ics". ''. ''. ""{$this->getEtag($specialDate1)}"". "{$this->getCal($specialDate1)}". ''. 'HTTP/1.1 200 OK'. ''. '', false); $response->assertSee( ''. "/dav/calendars/{$user->email}/birthdays/{$specialDate2->uuid}.ics". ''. ''. ""{$this->getEtag($specialDate2)}"". "{$this->getCal($specialDate2)}". ''. 'HTTP/1.1 200 OK'. ''. ''. '', false); } }