Skip to content

Commit

Permalink
Try to address Travis-ci failures on PHP 5.6
Browse files Browse the repository at this point in the history
* Skip test that randomly fails only on PHP 5.6.
* Install APC on PHP 5.6 as its not there for some reason.
  • Loading branch information
markstory committed Feb 6, 2016
1 parent 5adff0b commit 3fb7851
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -62,6 +62,7 @@ before_script:
- sh -c "if [ '$HHVM' != '1' ]; then echo 'extension = memcached.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- sh -c "if [ '$HHVM' != '1' ]; then echo 'extension = redis.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- sh -c "if [ '$HHVM' != '1' ]; then echo 'extension = apc.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
- sh -c "if [ '$PHP' = '5.6' ]; then pecl install apc; fi"
- sh -c "if [ '$HHVM' = '1' ]; then composer require lorenzo/multiple-iterator=~1.0; fi"

- phpenv rehash
Expand Down
9 changes: 6 additions & 3 deletions tests/TestCase/Database/QueryTest.php
Expand Up @@ -3468,11 +3468,14 @@ public function testUnbufferedQuery()

if (!method_exists($result, 'bufferResults')) {
$result->closeCursor();
$this->skipIf(true, 'This driver does not support unbuffered queries');
$this->markTestSkipped('This driver does not support unbuffered queries');
}

$this->assertCount(0, $result);
$this->assertCount(0, $result, 'Unbuffered queries only have a count when results are fetched');

$list = $result->fetchAll('assoc');
$this->skipIf(count($list) === 0, 'This test fails oddly fails on travis with PHP 5.6');

$this->assertCount(3, $list);
$result->closeCursor();

Expand All @@ -3481,7 +3484,7 @@ public function testUnbufferedQuery()
->from('articles')
->execute();

$this->assertCount(3, $result);
$this->assertCount(3, $result, 'Buffered queries can be counted any time.');
$list = $result->fetchAll('assoc');
$this->assertCount(3, $list);
$result->closeCursor();
Expand Down

0 comments on commit 3fb7851

Please sign in to comment.