diff --git a/.travis.yml b/.travis.yml index 6a9b3776ba5..e0f45b1e0df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,6 @@ php: matrix: include: - - php: hhvm - dist: trusty - php: 7.2 name: Backward compatibillity check env: DEPENDENCIES="roave/backward-compatibility-check" TEST_COMMAND="./vendor/bin/roave-backward-compatibility-check" diff --git a/composer.json b/composer.json index 4c1fcea4e9d..1e701df8b7c 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,7 @@ "prefer-stable": true, "extra": { "branch-alias": { - "dev-master": "2.11.x-dev" + "dev-master": "2.12.x-dev" } } } diff --git a/lib/Github/Api/GitData/Tags.php b/lib/Github/Api/GitData/Tags.php index 09f48bc0a80..11bf200a31f 100644 --- a/lib/Github/Api/GitData/Tags.php +++ b/lib/Github/Api/GitData/Tags.php @@ -56,11 +56,7 @@ public function create($username, $repository, array $params) throw new MissingArgumentException(['tag', 'message', 'object', 'type']); } - if (!isset($params['tagger'])) { - throw new MissingArgumentException('tagger'); - } - - if (!isset($params['tagger']['name'], $params['tagger']['email'], $params['tagger']['date'])) { + if (isset($params['tagger']) && !isset($params['tagger']['name'], $params['tagger']['email'], $params['tagger']['date'])) { throw new MissingArgumentException(['tagger.name', 'tagger.email', 'tagger.date']); } diff --git a/test/Github/Tests/Api/GitData/TagsTest.php b/test/Github/Tests/Api/GitData/TagsTest.php index 06543edeace..acc8dab6550 100644 --- a/test/Github/Tests/Api/GitData/TagsTest.php +++ b/test/Github/Tests/Api/GitData/TagsTest.php @@ -89,9 +89,8 @@ public function shouldNotCreateTagWithoutMessageParam() /** * @test - * @expectedException \Github\Exception\MissingArgumentException */ - public function shouldNotCreateTagWithoutTaggerParam() + public function shouldCreateTagWithoutTaggerParam() { $data = [ 'message' => 'some message', @@ -101,7 +100,7 @@ public function shouldNotCreateTagWithoutTaggerParam() ]; $api = $this->getApiMock(); - $api->expects($this->never()) + $api->expects($this->once()) ->method('post'); $api->create('KnpLabs', 'php-github-api', $data);