Permalink
Browse files

improve test config

  • Loading branch information...
1 parent 815b2db commit 3710e563f9d2863696b7b9fa66807b98bb4be3b1 @stevenmaguire stevenmaguire committed Aug 14, 2015
Showing with 19 additions and 30 deletions.
  1. +1 −1 .scrutinizer.yml
  2. +8 −12 .travis.yml
  3. +3 −3 composer.json
  4. +4 −8 tests/ServerTest.php
  5. +3 −6 tests/TrelloServerTest.php
View
@@ -19,7 +19,7 @@ checks:
tools:
external_code_coverage:
timeout: 600
- runs: 3
+ runs: 4
php_analyzer: true
php_code_coverage: false
php_code_sniffer:
View
@@ -5,22 +5,18 @@ php:
- 5.4
- 5.5
- 5.6
+ - 7.0
- hhvm
before_script:
- - composer self-update
- - composer install
- - pyrus install pear/PHP_CodeSniffer
- - phpenv rehash
+ - travis_retry composer self-update
+ - travis_retry composer install --no-interaction --prefer-source --dev
+ - travis_retry phpenv rehash
script:
- - phpcs --standard=psr2 src/
- - phpunit --coverage-text
+ - ./vendor/bin/phpcs --standard=psr2 src/
+ - ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
after_script:
- - wget https://scrutinizer-ci.com/ocular.phar
- - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
-
-matrix:
- allow_failures:
- - php: hhvm
+ - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ] && [ "$TRAVIS_PHP_VERSION" != "7.0" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
+ - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ] && [ "$TRAVIS_PHP_VERSION" != "7.0" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
View
@@ -7,9 +7,9 @@
"guzzle/guzzle": "3.*"
},
"require-dev": {
- "phpunit/phpunit": "*",
- "mockery/mockery": "0.7.2",
- "satooshi/php-coveralls": "dev-master"
+ "phpunit/phpunit": "~4.0",
+ "mockery/mockery": "~0.9",
+ "squizlabs/php_codesniffer": "~2.0"
},
"keywords": [
"oauth",
View
@@ -69,8 +69,7 @@ public function testCreatingWithObject()
public function testGettingTemporaryCredentials()
{
- $server = m::mock('League\OAuth1\Client\Tests\ServerStub[createHttpClient]');
- $server->__construct($this->getMockClientCredentials());
+ $server = m::mock('League\OAuth1\Client\Tests\ServerStub[createHttpClient]', array($this->getMockClientCredentials()));
$server->shouldReceive('createHttpClient')->andReturn($client = m::mock('stdClass'));
@@ -126,8 +125,7 @@ public function testGettingTokenCredentialsFailsWithManInTheMiddle()
public function testGettingTokenCredentials()
{
- $server = m::mock('League\OAuth1\Client\Tests\ServerStub[createHttpClient]');
- $server->__construct($this->getMockClientCredentials());
+ $server = m::mock('League\OAuth1\Client\Tests\ServerStub[createHttpClient]', array($this->getMockClientCredentials()));
$temporaryCredentials = m::mock('League\OAuth1\Client\Credentials\TemporaryCredentials');
$temporaryCredentials->shouldReceive('getIdentifier')->andReturn('temporarycredentialsidentifier');
@@ -163,8 +161,7 @@ public function testGettingTokenCredentials()
public function testGettingTokenCredentialsWithUserAgent()
{
$userAgent = 'FooBar';
- $server = m::mock('League\OAuth1\Client\Tests\ServerStub[createHttpClient]');
- $server->__construct($this->getMockClientCredentials());
+ $server = m::mock('League\OAuth1\Client\Tests\ServerStub[createHttpClient]', array($this->getMockClientCredentials()));
$temporaryCredentials = m::mock('League\OAuth1\Client\Credentials\TemporaryCredentials');
$temporaryCredentials->shouldReceive('getIdentifier')->andReturn('temporarycredentialsidentifier');
@@ -201,8 +198,7 @@ public function testGettingTokenCredentialsWithUserAgent()
public function testGettingUserDetails()
{
- $server = m::mock('League\OAuth1\Client\Tests\ServerStub[createHttpClient,protocolHeader]');
- $server->__construct($this->getMockClientCredentials());
+ $server = m::mock('League\OAuth1\Client\Tests\ServerStub[createHttpClient,protocolHeader]', array($this->getMockClientCredentials()));
$temporaryCredentials = m::mock('League\OAuth1\Client\Credentials\TokenCredentials');
$temporaryCredentials->shouldReceive('getIdentifier')->andReturn('tokencredentialsidentifier');
@@ -42,8 +42,7 @@ public function testCreatingWithObject()
public function testGettingTemporaryCredentials()
{
- $server = m::mock('League\OAuth1\Client\Server\Trello[createHttpClient]');
- $server->__construct($this->getMockClientCredentials());
+ $server = m::mock('League\OAuth1\Client\Server\Trello[createHttpClient]', array($this->getMockClientCredentials()));
$server->shouldReceive('createHttpClient')->andReturn($client = m::mock('stdClass'));
@@ -192,8 +191,7 @@ public function testGettingTokenCredentialsFailsWithManInTheMiddle()
public function testGettingTokenCredentials()
{
- $server = m::mock('League\OAuth1\Client\Server\Trello[createHttpClient]');
- $server->__construct($this->getMockClientCredentials());
+ $server = m::mock('League\OAuth1\Client\Server\Trello[createHttpClient]', array($this->getMockClientCredentials()));
$temporaryCredentials = m::mock('League\OAuth1\Client\Credentials\TemporaryCredentials');
$temporaryCredentials->shouldReceive('getIdentifier')->andReturn('temporarycredentialsidentifier');
@@ -227,8 +225,7 @@ public function testGettingTokenCredentials()
public function testGettingUserDetails()
{
- $server = m::mock('League\OAuth1\Client\Server\Trello[createHttpClient,protocolHeader]');
- $server->__construct($this->getMockClientCredentials());
+ $server = m::mock('League\OAuth1\Client\Server\Trello[createHttpClient,protocolHeader]', array($this->getMockClientCredentials()));
$temporaryCredentials = m::mock('League\OAuth1\Client\Credentials\TokenCredentials');
$temporaryCredentials->shouldReceive('getIdentifier')->andReturn('tokencredentialsidentifier');

0 comments on commit 3710e56

Please sign in to comment.