Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@
sudo: false
language: php
sudo: false

php:
- 5.6

env:
- MONGO_VERSION=stable
cache:
directories:
- $HOME/.composer/cache/files

matrix:
include:
# Test the latest
- php: 5.6
env: MONGO_VERSION=stable
- php: 7.1
env: ADAPTER_VERSION="^1.0.0" MONGODB_VERSION=stable
- php: 7.2
env: ADAPTER_VERSION="^1.0.0" MONGODB_VERSION=stable

services: mongodb
# Test with the lowest deps
- php: 5.6
env: MONGO_VERSION=stable COMPOSER_FLAGS="--prefer-stable --prefer-lowest --prefer-dist"
- php: 7.2
# Note that the ADAPTER_VERSION is pinned to 1.0.0 when testing lowest deps
env: ADAPTER_VERSION="1.0.0" MONGODB_VERSION=stable COMPOSER_FLAGS="--prefer-stable --prefer-lowest --prefer-dist"

before_script:
- if [ "x${MONGO_VERSION}" != "x" ]; then yes '' | pecl -q install -f mongo-${MONGO_VERSION}; fi
- if [ "x${MONGODB_VERSION}" != "x" ]; then pecl install -f mongodb-${MONGODB_VERSION}; fi
- if [ "x${ADAPTER_VERSION}" != "x" ]; then composer require "alcaeus/mongo-php-adapter=${ADAPTER_VERSION}" --ignore-platform-reqs; fi
# Not using code coverage
- phpenv config-rm xdebug.ini
- if ! [ -z "$MONGO_VERSION" ]; then yes '' | pecl -q install -f mongo-${MONGO_VERSION}; fi
- if ! [ -z "$MONGODB_VERSION" ]; then pecl install -f mongodb-${MONGODB_VERSION}; fi
- if ! [ -z "$ADAPTER_VERSION" ]; then composer require "alcaeus/mongo-php-adapter=${ADAPTER_VERSION}" --ignore-platform-reqs; fi
- composer self-update
- composer install --dev
# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --ignore-platform-reqs --quiet; fi
- composer update -v ${COMPOSER_FLAGS}

script:
- ./vendor/bin/phpunit
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"require-dev": {
"antimattr/test-case": "~1.0@stable",
"phpunit/phpunit": "^5.0",
"phpunit/phpunit-mock-objects": ">=3.0.4",
"sebastian/version": ">=1.0.3",
"sebastian/comparator": ">=1.2.3",
"friendsofphp/php-cs-fixer": "^2.0",
"mikey179/vfsStream": "1.*"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class OutputWriterTest extends AntiMattrTestCase

protected function setUp()
{
$this->output = $this->createMock('Symfony\Component\Console\Output\OutputInterface');
$this->output = $this->buildMock('Symfony\Component\Console\Output\OutputInterface');
$output = $this->output;
$this->outputWriter = new OutputWriter(function ($message) use ($output) {
return $output->writeln($message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,14 @@ public function testExecuteWithShowingVersions()
)
)
;

$this->output->expects($this->at(0))
->method('writeln')
->with(
"\n <info>==</info> Configuration\n"
)
;

$this->output->expects($this->at(1))
->method('writeln')
->with(
Expand All @@ -330,6 +332,7 @@ public function testExecuteWithShowingVersions()
)
)
;

$this->output->expects($this->at(2))
->method('writeln')
->with(
Expand All @@ -340,6 +343,7 @@ public function testExecuteWithShowingVersions()
)
)
;

$this->output->expects($this->at(3))
->method('writeln')
->with(
Expand Down Expand Up @@ -441,20 +445,28 @@ public function testExecuteWithShowingVersions()
->with("\n <info>==</info> Available Migration Versions\n")
;

$this->output->expects($this->at(39))
->method('writeln')
->with("\n <info>==</info> Previously Executed Unavailable Migration Versions\n")
;
$this->output->expects($this->at(40))
->method('writeln')
->with(
sprintf(
' <comment>>></comment> %s (<comment>%s</comment>)',
\DateTime::createFromFormat('YmdHis', $unavailableMigratedVersion)->format('Y-m-d H:i:s'),
$unavailableMigratedVersion
$isLowest = false;
if (class_exists('\PHPUnit_Runner_Version')) {
$isLowest = '5.0.0' === \PHPUnit_Runner_Version::id();
}

if (!$isLowest) {
$this->output->expects($this->at(39))
->method('writeln')
->with("\n <info>==</info> Previously Executed Unavailable Migration Versions\n")
;

$this->output->expects($this->at(40))
->method('writeln')
->with(
sprintf(
' <comment>>></comment> %s (<comment>%s</comment>)',
\DateTime::createFromFormat('YmdHis', $unavailableMigratedVersion)->format('Y-m-d H:i:s'),
$unavailableMigratedVersion
)
)
)
;
;
}

// Run command, run.
$this->command->run(
Expand Down