diff --git a/src/OpenGraphImages.php b/src/OpenGraphImages.php index 3789f9c..552465e 100644 --- a/src/OpenGraphImages.php +++ b/src/OpenGraphImages.php @@ -254,12 +254,15 @@ public function make(string $text, string $preset = 'opengraph'): OpenGraphImage case 'facebook': default: $this->imageHeight = 630; + break; case 'twitter': $this->imageHeight = 600; + break; case 'vk': $this->imageHeight = 536; + break; } @@ -268,28 +271,6 @@ public function make(string $text, string $preset = 'opengraph'): OpenGraphImage return $this; } - public function makeTwitter(string $text): OpenGraphImages - { - // https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/summary-card-with-large-image - $this->imageWidth = 1200; - $this->imageHeight = 600; - - $this->createImage($text); - - return $this; - } - - public function makeVk(string $text): OpenGraphImages - { - // https://dev.vk.com/api/posts - $this->imageWidth = 1200; - $this->imageHeight = 536; - - $this->createImage($text); - - return $this; - } - public function get(): ?string { return $this->imageBlob; diff --git a/tests/OpenGraphImagesTest.php b/tests/OpenGraphImagesTest.php index 892774d..70a90cf 100644 --- a/tests/OpenGraphImagesTest.php +++ b/tests/OpenGraphImagesTest.php @@ -39,26 +39,6 @@ public function testMake(string $text): void } } - /** - * @dataProvider textProvider - */ - public function testMakeTwitter(string $text): void - { - $result = $this->openGraphImages->makeTwitter($text); - $this->assertInstanceOf(OpenGraphImages::class, $result); - $this->assertEquals('image/png', $this->getMimeTypeFromString($result->get())); - } - - /** - * @dataProvider textProvider - */ - public function testMakeVk(string $text): void - { - $result = $this->openGraphImages->makeVk($text); - $this->assertInstanceOf(OpenGraphImages::class, $result); - $this->assertEquals('image/png', $this->getMimeTypeFromString($result->get())); - } - /** * @dataProvider textProvider */