getOutput() public method

So I build a workaround to build a .ics (= vcalender) file.
public getOutput ( ) : string
return string
コード例 #1
0
ファイル: VCardTest.php プロジェクト: AoDispor/vcard
 /**
  * Test Email
  *
  * @dataProvider emailDataProvider $emails
  */
 public function testEmail($emails = array())
 {
     foreach ($emails as $key => $email) {
         if (is_string($key)) {
             $this->vcard->addEmail($email, $key);
         } else {
             $this->vcard->addEmail($email);
         }
     }
     foreach ($emails as $key => $email) {
         if (is_string($key)) {
             $this->assertContains('EMAIL;INTERNET;' . $key . ':' . $email, $this->vcard->getOutput());
         } else {
             $this->assertContains('EMAIL;INTERNET:' . $email, $this->vcard->getOutput());
         }
     }
 }
コード例 #2
0
 private function buildVcardResponse(VCard $vcard)
 {
     // Build response
     $response = new Response($vcard->getOutput());
     foreach ($vcard->getHeaders(true) as $key => $val) {
         $response->headers->set($key, $val);
     }
     return $response;
 }