Skip to content

Commit

Permalink
Merge branch 'xabbuh-patch-1'
Browse files Browse the repository at this point in the history
  • Loading branch information
k-k committed Dec 18, 2015
2 parents 9b6362d + b3af79e commit d575cd8
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 22 deletions.
41 changes: 22 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,41 @@ sudo: false

cache:
directories:
- $HOME/.composer/cache
- $HOME/.composer/cache/files

php:
- 5.4
- 5.5
- 5.6
- hhvm

matrix:
exclude:
- php: 5.4
env: SYMFONY_VERSION=3.0.*
fast_finish: true
include:
- php: 5.6
env: SYMFONY_VERSION=2.3.*
- php: 5.6
env: SYMFONY_VERSION=2.6.*
- php: 5.6
env: SYMFONY_VERSION=2.7.*
- php: 5.6
env: SYMFONY_VERSION=2.8.*
- php: 7.0
env: COVERAGE=yes
allow_failures:
- php: hhvm

env:
- SYMFONY_VERSION=2.3.*
- SYMFONY_VERSION=2.4.*
- SYMFONY_VERSION=2.5.*
- SYMFONY_VERSION=2.6.*
- SYMFONY_VERSION=2.7.*
- SYMFONY_VERSION=2.8.*
- SYMFONY_VERSION=3.0.*

install:
before_install:
- if [ "$COVERAGE" != "yes" -a "$TRAVIS_PHP_VERSION" != "hhvm" ]; then phpenv config-rm xdebug.ini; fi
- composer self-update
- composer require symfony/framework-bundle:${SYMFONY_VERSION} --no-update
- if [ "$SYOMFONY_VERSION" != "" ]; then composer require symfony/framework-bundle:${SYMFONY_VERSION} --no-update; fi

install:
- composer install --prefer-dist

script: phpunit --coverage-text --coverage-clover=coverage.clover
script:
- if [ "$COVERAGE" = "yes" ]; then phpunit --coverage-text --coverage-clover=coverage.clover; else phpunit; fi

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
- if [ "$COVERAGE" = "yes" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [ "$COVERAGE" = "yes" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi

7 changes: 6 additions & 1 deletion tests/Event/MessageEventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ public function testMessageEventConstructor()
$event = new MessageEvent('test', new Message(123, ['foo' => 'bar'], ['bar' => 'baz']));
$this->assertInstanceOf('Uecode\Bundle\QPushBundle\Event\MessageEvent', $event);

$this->setExpectedException('PHPUnit_Framework_Error');
if (version_compare(PHP_VERSION, '7.0', '>=')) {
$this->setExpectedException('TypeError');
} else {
$this->setExpectedException('PHPUnit_Framework_Error');
}

$event = new MessageEvent('test', ['bad argument']);
}

Expand Down
7 changes: 6 additions & 1 deletion tests/Message/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ public function testConstructor()
$message = new Message(123, ['foo' => 'bar'], ['baz' => 'qux']);
$this->assertInstanceOf('Uecode\Bundle\QPushBundle\Message\Message', $message);

$this->setExpectedException('PHPUnit_Framework_Error');
if (version_compare(PHP_VERSION, '7.0', '>=')) {
$this->setExpectedException('TypeError');
} else {
$this->setExpectedException('PHPUnit_Framework_Error');
}

new Message(123, ['foo' => 'bar'], 'invalid argument');
}
}
7 changes: 6 additions & 1 deletion tests/Message/NotificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ public function testConstructor()
$notification = new Notification(123, ['foo' => 'bar'], ['baz' => 'qux']);
$this->assertInstanceOf('Uecode\Bundle\QPushBundle\Message\Notification', $notification);

$this->setExpectedException('PHPUnit_Framework_Error');
if (version_compare(PHP_VERSION, '7.0', '>=')) {
$this->setExpectedException('TypeError');
} else {
$this->setExpectedException('PHPUnit_Framework_Error');
}

new Notification(123, ['foo' => 'bar'], 'invalid argument');
}
}

0 comments on commit d575cd8

Please sign in to comment.