Skip to content

Commit d575cd8

Browse files
committed
Merge branch 'xabbuh-patch-1'
2 parents 9b6362d + b3af79e commit d575cd8

File tree

4 files changed

+40
-22
lines changed

4 files changed

+40
-22
lines changed

.travis.yml

+22-19
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,41 @@ sudo: false
44

55
cache:
66
directories:
7-
- $HOME/.composer/cache
7+
- $HOME/.composer/cache/files
88

99
php:
1010
- 5.4
1111
- 5.5
12-
- 5.6
1312
- hhvm
1413

1514
matrix:
16-
exclude:
17-
- php: 5.4
18-
env: SYMFONY_VERSION=3.0.*
15+
fast_finish: true
16+
include:
17+
- php: 5.6
18+
env: SYMFONY_VERSION=2.3.*
19+
- php: 5.6
20+
env: SYMFONY_VERSION=2.6.*
21+
- php: 5.6
22+
env: SYMFONY_VERSION=2.7.*
23+
- php: 5.6
24+
env: SYMFONY_VERSION=2.8.*
25+
- php: 7.0
26+
env: COVERAGE=yes
1927
allow_failures:
2028
- php: hhvm
2129

22-
env:
23-
- SYMFONY_VERSION=2.3.*
24-
- SYMFONY_VERSION=2.4.*
25-
- SYMFONY_VERSION=2.5.*
26-
- SYMFONY_VERSION=2.6.*
27-
- SYMFONY_VERSION=2.7.*
28-
- SYMFONY_VERSION=2.8.*
29-
- SYMFONY_VERSION=3.0.*
30-
31-
install:
30+
before_install:
31+
- if [ "$COVERAGE" != "yes" -a "$TRAVIS_PHP_VERSION" != "hhvm" ]; then phpenv config-rm xdebug.ini; fi
3232
- composer self-update
33-
- composer require symfony/framework-bundle:${SYMFONY_VERSION} --no-update
33+
- if [ "$SYOMFONY_VERSION" != "" ]; then composer require symfony/framework-bundle:${SYMFONY_VERSION} --no-update; fi
34+
35+
install:
3436
- composer install --prefer-dist
3537

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

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

tests/Event/MessageEventTest.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ public function testMessageEventConstructor()
4848
$event = new MessageEvent('test', new Message(123, ['foo' => 'bar'], ['bar' => 'baz']));
4949
$this->assertInstanceOf('Uecode\Bundle\QPushBundle\Event\MessageEvent', $event);
5050

51-
$this->setExpectedException('PHPUnit_Framework_Error');
51+
if (version_compare(PHP_VERSION, '7.0', '>=')) {
52+
$this->setExpectedException('TypeError');
53+
} else {
54+
$this->setExpectedException('PHPUnit_Framework_Error');
55+
}
56+
5257
$event = new MessageEvent('test', ['bad argument']);
5358
}
5459

tests/Message/MessageTest.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ public function testConstructor()
4444
$message = new Message(123, ['foo' => 'bar'], ['baz' => 'qux']);
4545
$this->assertInstanceOf('Uecode\Bundle\QPushBundle\Message\Message', $message);
4646

47-
$this->setExpectedException('PHPUnit_Framework_Error');
47+
if (version_compare(PHP_VERSION, '7.0', '>=')) {
48+
$this->setExpectedException('TypeError');
49+
} else {
50+
$this->setExpectedException('PHPUnit_Framework_Error');
51+
}
52+
4853
new Message(123, ['foo' => 'bar'], 'invalid argument');
4954
}
5055
}

tests/Message/NotificationTest.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ public function testConstructor()
4747
$notification = new Notification(123, ['foo' => 'bar'], ['baz' => 'qux']);
4848
$this->assertInstanceOf('Uecode\Bundle\QPushBundle\Message\Notification', $notification);
4949

50-
$this->setExpectedException('PHPUnit_Framework_Error');
50+
if (version_compare(PHP_VERSION, '7.0', '>=')) {
51+
$this->setExpectedException('TypeError');
52+
} else {
53+
$this->setExpectedException('PHPUnit_Framework_Error');
54+
}
55+
5156
new Notification(123, ['foo' => 'bar'], 'invalid argument');
5257
}
5358
}

0 commit comments

Comments
 (0)