From 9bed0f7a68b15b38a20ad8281375e36a74c59129 Mon Sep 17 00:00:00 2001 From: Eduardo Bizarro Date: Tue, 13 Sep 2016 22:55:16 -0300 Subject: [PATCH 1/2] php 5.4 support removed from builds and 7.1 added --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9e0c038..deee56d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,9 @@ language: php php: - - 5.5 - 5.6 - 7.0 + - 7.1 - hhvm matrix: From f71d995e8ad47e4fbd93032b73a9033b52e9a540 Mon Sep 17 00:00:00 2001 From: Eduardo Bizarro Date: Mon, 24 Oct 2016 19:13:05 -0200 Subject: [PATCH 2/2] deprecated warning in setImages and addImages --- src/SEOTools/TwitterCards.php | 15 ++++++++++++++- tests/SEOTools/TwitterCardsTest.php | 11 ++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/SEOTools/TwitterCards.php b/src/SEOTools/TwitterCards.php index 075c93a..a56b15a 100644 --- a/src/SEOTools/TwitterCards.php +++ b/src/SEOTools/TwitterCards.php @@ -36,7 +36,7 @@ public function __construct(array $defaults = []) /** * @param bool $minify - * + * * @return string */ public function generate($minify = false) @@ -150,6 +150,8 @@ public function setUrl($url) * @param string|array $image * * @return TwitterCardsContract + * + * @deprecated use setImage($image) instead */ public function addImage($image) { @@ -164,6 +166,8 @@ public function addImage($image) * @param string|array $images * * @return TwitterCardsContract + * + * @deprecated use setImage($image) instead */ public function setImages($images) { @@ -171,4 +175,13 @@ public function setImages($images) return $this->addImage($images); } + + /** + * @param $image + * @return TwitterCardsContract + */ + public function setImage($image) + { + return $this->addValue('image', $image); + } } diff --git a/tests/SEOTools/TwitterCardsTest.php b/tests/SEOTools/TwitterCardsTest.php index 12b4f39..7c1ca1b 100644 --- a/tests/SEOTools/TwitterCardsTest.php +++ b/tests/SEOTools/TwitterCardsTest.php @@ -69,7 +69,7 @@ public function test_set_type() $this->setRightAssertion($expected); } - public function test_set_image() + public function test_set_images() { $this->twitterCards->setImages(['sayajin.png', 'namekusei.png']); @@ -79,6 +79,15 @@ public function test_set_image() $this->setRightAssertion($expected); } + public function test_set_image() + { + $this->twitterCards->setImage('sayajin.png'); + + $expected = ""; + + $this->setRightAssertion($expected); + } + /** * @param $expectedString */