Skip to content

Commit 970c271

Browse files
committed
Fix broken tests on PHPUnit 5
1 parent c763e59 commit 970c271

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ before_install:
1717

1818
install:
1919
- composer require --no-update --no-interaction "phpunit/phpunit:*" "squizlabs/php_codesniffer:*" "fabpot/php-cs-fixer:*"
20-
- travis_retry composer install --no-interaction --prefer-source
20+
- travis_retry composer update --no-interaction --prefer-source
2121
- travis_retry wget https://scrutinizer-ci.com/ocular.phar
2222

2323
script:

tests/bootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55

66
require __DIR__ . '/extra/TestMockObject.php';
77
require __DIR__ . '/extra/ExtendsTestMockObject.php';
8+
require __DIR__ . '/extra/StringObject.php';

tests/extra/TestMockObject.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ class TestMockObject
1010

1111
public function __toString()
1212
{
13+
return '';
1314
}
1415
}

tests/tests/ObjectEncodingTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@ public function testStringConversion()
3434
'object.method' => false,
3535
]);
3636

37-
$mock = $this->getMock('Test\TestMockObject', ['__toString', 'toPHP']);
38-
$mock->expects($this->once())->method('__toString')->will($this->returnValue('Mocked'));
37+
$mock = $this->getMock('Test\StringObject', ['toPHP']);
3938
$mock->expects($this->exactly(0))->method('toPHP');
4039

41-
$this->assertSame('Mocked', eval('return ' . $encoder->encode($mock) . ';'));
40+
$this->assertSame('Stringed', eval('return ' . $encoder->encode($mock) . ';'));
4241
}
4342

4443
public function testPHPValue()

0 commit comments

Comments
 (0)