diff --git a/src/Formatter/Formatter.php b/src/Formatter/Formatter.php index a379fb1..14c0167 100644 --- a/src/Formatter/Formatter.php +++ b/src/Formatter/Formatter.php @@ -36,8 +36,8 @@ public function addVCard(VCard $vCard): self public function download(): void { - foreach ($this->getHeaders() as $header) { - header($header); + foreach ($this->getHeaders() as $key => $value) { + header(sprintf("%s: %s", $key, $value)); } echo $this->getContent(); diff --git a/src/Formatter/Property/RoleFormatter.php b/src/Formatter/Property/RoleFormatter.php new file mode 100644 index 0000000..a72d0cb --- /dev/null +++ b/src/Formatter/Property/RoleFormatter.php @@ -0,0 +1,10 @@ +thirdVCard = (new VCard(Kind::organization())) ->add(new Title('Apple')) + ->add(new Role('Fruit')) ->add(new Photo(__DIR__ . '/assets/landscape.jpeg')) ->add(new Logo(__DIR__ . '/assets/landscape.jpeg')) ->add(new Telephone('+32 486 00 00 00')); @@ -186,8 +188,9 @@ public function testVCardGetProperties(): void $this->assertCount(1, $this->secondVCard->getProperties(Name::class)); $this->assertCount(1, $this->secondVCard->getProperties(Address::class)); - $this->assertCount(4, $this->thirdVCard->getProperties()); + $this->assertCount(5, $this->thirdVCard->getProperties()); $this->assertCount(1, $this->thirdVCard->getProperties(Title::class)); + $this->assertCount(1, $this->thirdVCard->getProperties(Role::class)); $this->assertCount(1, $this->thirdVCard->getProperties(Photo::class)); $this->assertCount(1, $this->thirdVCard->getProperties(Logo::class)); $this->assertCount(1, $this->thirdVCard->getProperties(Telephone::class));