diff --git a/.php_cs b/.php_cs index c7b93dc..0767049 100644 --- a/.php_cs +++ b/.php_cs @@ -16,12 +16,6 @@ return PhpCsFixer\Config::create() // '@PHP56Migration' => true, // to prepare PHP56 migration 'array_syntax' => ['syntax' => 'long'], 'combine_consecutive_unsets' => true, - 'general_phpdoc_annotation_remove' => [ - // one should use PHPUnit methods to set up expected exception instead of annotations - 'expectedException', - 'expectedExceptionMessage', - 'expectedExceptionMessageRegExp' - ], 'header_comment' => ['header' => $header], 'heredoc_to_nowdoc' => true, 'no_extra_consecutive_blank_lines' => [ diff --git a/.travis.yml b/.travis.yml index c5de145..829f649 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,6 @@ before_script: - travis_retry composer self-update - travis_retry composer install --prefer-source --no-interaction -script: +script: - vendor/bin/phpunit diff --git a/tests/GitlabApiClientTest.php b/tests/GitlabApiClientTest.php index f4a3219..7c3ff46 100644 --- a/tests/GitlabApiClientTest.php +++ b/tests/GitlabApiClientTest.php @@ -199,11 +199,11 @@ public function testOptions() { $client = new SUT(self::BASE_PATH, array( 'new_option' => 'value', - 'timeout' => 666 + 'timeout' => 666, )); $this->assertEquals('value', $client->getOption('new_option')); $this->assertEquals(666, $client->getOption('timeout')); - $this->expectException("InvalidArgumentException"); + $this->expectException('InvalidArgumentException'); $client->getOption('missing-option'); } @@ -227,12 +227,12 @@ public function testHeaders() 'HEADER1' => 'VALUE1', 'HEADER2' => 'VALUE2', 'HEADER3' => 'VALUE3', - 'HEADER4' => 'VALUE4' + 'HEADER4' => 'VALUE4', ), $datas); return true; }), - $this->anything() + $this->anything(), ), // next call must have only global ones array( @@ -247,21 +247,20 @@ public function testHeaders() return true; }), - $this->anything() + $this->anything(), ) ) ->willReturn(new Response(200, '', '', array())); - $sut ->setHeaders(array( 'HEADER1' => 'VALUE1', - 'HEADER2' => 'VALUE2' + 'HEADER2' => 'VALUE2', )) ->path(2) ->get(array(), array( 'HEADER3' => 'VALUE3', - 'HEADER4' => 'VALUE4' + 'HEADER4' => 'VALUE4', )); $sut->path(2)->get(); @@ -292,19 +291,21 @@ public function testHeaders() ->authenticate('my-precious-token', SUT::AUTH_OAUTH_TOKEN, 'im sudoers') ->setHeaders(array( 'Authorization' => 'VALUE1', - 'HEADER2' => 'VALUE2' + 'HEADER2' => 'VALUE2', )) ->path(2) ->get(array(), array( 'HEADER3' => 'VALUE3', - 'HEADER4' => 'VALUE4' + 'HEADER4' => 'VALUE4', )); } + /** + * @expectedExceptionMessage scalar expected + * @expectedException \InvalidArgumentException + */ public function testIncorrectPath() { - $this->expectExceptionMessage('scalar expected'); - $this->expectException('InvalidArgumentException'); $this->getMockedSUT()->path(array('array' => 'not accepted here')); }