|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace NotificationChannels\WhatsApp\Test; |
| 4 | + |
| 5 | +use NotificationChannels\WhatsApp\Component; |
| 6 | +use PHPUnit\Framework\TestCase; |
| 7 | + |
| 8 | +final class ComponentTest extends TestCase |
| 9 | +{ |
| 10 | + /** @test */ |
| 11 | + public function it_can_return_a_currency_component() |
| 12 | + { |
| 13 | + $component = Component::currency(10, 'EUR'); |
| 14 | + |
| 15 | + $this->assertInstanceOf(Component\Currency::class, $component); |
| 16 | + } |
| 17 | + |
| 18 | + /** @test */ |
| 19 | + public function it_can_return_a_datetime_component() |
| 20 | + { |
| 21 | + $component = Component::dateTime(new \DateTimeImmutable()); |
| 22 | + |
| 23 | + $this->assertInstanceOf(Component\DateTime::class, $component); |
| 24 | + } |
| 25 | + |
| 26 | + /** @test */ |
| 27 | + public function it_can_return_a_document_component() |
| 28 | + { |
| 29 | + $component = Component::document('https://www.netflie.es/my_document.pdf'); |
| 30 | + |
| 31 | + $this->assertInstanceOf(Component\Document::class, $component); |
| 32 | + } |
| 33 | + |
| 34 | + /** @test */ |
| 35 | + public function it_can_return_an_image_component() |
| 36 | + { |
| 37 | + $component = Component::image('https://www.netflie.es/my_image.png'); |
| 38 | + |
| 39 | + $this->assertInstanceOf(Component\Image::class, $component); |
| 40 | + } |
| 41 | + |
| 42 | + /** @test */ |
| 43 | + public function it_can_return_a_text_component() |
| 44 | + { |
| 45 | + $component = Component::text('Hey there!'); |
| 46 | + |
| 47 | + $this->assertInstanceOf(Component\Text::class, $component); |
| 48 | + } |
| 49 | + |
| 50 | + /** @test */ |
| 51 | + public function it_can_return_a_vide_component() |
| 52 | + { |
| 53 | + $component = Component::video('https://www.netflie.es/my_image.webm'); |
| 54 | + |
| 55 | + $this->assertInstanceOf(Component\Video::class, $component); |
| 56 | + } |
| 57 | +} |
0 commit comments