Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #26 from niels-nijens/drop-php5.4-support
Browse files Browse the repository at this point in the history
Remove PHP 5.4 support
  • Loading branch information
niels-nijens committed May 15, 2016
2 parents bf0dd70 + 0583c20 commit 36724ea
Show file tree
Hide file tree
Showing 8 changed files with 199 additions and 154 deletions.
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ sudo: false

matrix:
include:
- php: 5.4
- php: 5.5
- php: 5.6
- php: 7.0
Expand All @@ -13,14 +12,11 @@ matrix:
- php: nightly
fast_finish: true

before_install:
- composer self-update
- if [[ $TRAVIS_PHP_VERSION = 5.4 ]]; then composer update; fi;
before_install: composer self-update

install: composer install

before_script:
- mkdir -p build/logs
before_script: mkdir -p build/logs

script: vendor/bin/phpunit --coverage-clover build/logs/clover.xml

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"php": "^5.4 || ^7.0",
"php": "^5.5 || ^7.0",
"symfony/process": "^2.7 || ^3.0"
},
"require-dev": {
Expand Down
6 changes: 4 additions & 2 deletions src/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace Accompli\Chrono;

use Accompli\Chrono\Adapter\AdapterInterface;
use Accompli\Chrono\Adapter\GitAdapter;
use Accompli\Chrono\Adapter\SubversionAdapter;
use Accompli\Chrono\Process\ProcessExecutorInterface;
use InvalidArgumentException;

Expand Down Expand Up @@ -40,8 +42,8 @@ class Repository implements RepositoryInterface
* @var array
*/
private $adapters = array(
'Accompli\Chrono\Adapter\GitAdapter',
'Accompli\Chrono\Adapter\SubversionAdapter',
GitAdapter::class,
SubversionAdapter::class,
);

/**
Expand Down
7 changes: 5 additions & 2 deletions tests/Adapter/AbstractAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Accompli\Chrono\Test;

use Accompli\Chrono\Adapter\AbstractAdapter;
use Accompli\Chrono\Process\ProcessExecutorInterface;
use PHPUnit_Framework_TestCase;

/**
Expand All @@ -18,9 +20,10 @@ public function testConstruct()
{
$repositoryUrl = 'https://github.com/accompli/chrono.git';
$repositoryDirectory = __DIR__;
$processExecutorMock = $this->getMockBuilder('Accompli\Chrono\Process\ProcessExecutorInterface')->getMock();
$processExecutorMock = $this->getMockBuilder(ProcessExecutorInterface::class)
->getMock();

$abstractAdapter = $this->getMockBuilder('Accompli\Chrono\Adapter\AbstractAdapter')
$abstractAdapter = $this->getMockBuilder(AbstractAdapter::class)
->setConstructorArgs(array($repositoryUrl, $repositoryDirectory, $processExecutorMock))
->getMockForAbstractClass();

Expand Down
26 changes: 13 additions & 13 deletions tests/Adapter/GitAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,31 +85,31 @@ public function provideTestSupportsRepository()
{
$provideTest = array();

$processExecutorMock = $this->getMockBuilder('Accompli\Chrono\Process\ProcessExecutorInterface')
$processExecutorMock = $this->getMockBuilder(ProcessExecutorInterface::class)
->getMock();
$processExecutorMock->expects($this->once())
->method('execute')
->with($this->equalTo('git --version'))
->willReturn(new ProcessExecutionResult(1, '', ''));
$provideTest[] = array('https://github.com/accompli/chrono.git', $processExecutorMock, false);

$processExecutorMock = $this->getMockBuilder('Accompli\Chrono\Process\ProcessExecutorInterface')
$processExecutorMock = $this->getMockBuilder(ProcessExecutorInterface::class)
->getMock();
$processExecutorMock->expects($this->once())
->method('execute')
->with($this->equalTo('git --version'))
->willReturn(new ProcessExecutionResult(0, '', ''));
$provideTest[] = array('https://github.com/accompli/chrono.git', $processExecutorMock, true);

$processExecutorMock = $this->getMockBuilder('Accompli\Chrono\Process\ProcessExecutorInterface')
$processExecutorMock = $this->getMockBuilder(ProcessExecutorInterface::class)
->getMock();
$processExecutorMock->expects($this->once())
->method('execute')
->with($this->equalTo('git --version'))
->willReturn(new ProcessExecutionResult(0, '', ''));
$provideTest[] = array('[email protected]:accompli/chrono.git', $processExecutorMock, true);

$processExecutorMock = $this->getMockBuilder('Accompli\Chrono\Process\ProcessExecutorInterface')
$processExecutorMock = $this->getMockBuilder(ProcessExecutorInterface::class)
->getMock();
$processExecutorMock->expects($this->exactly(2))
->method('execute')
Expand All @@ -123,7 +123,7 @@ public function provideTestSupportsRepository()
);
$provideTest[] = array('[email protected]:accompli/chrono', $processExecutorMock, true);

$processExecutorMock = $this->getMockBuilder('Accompli\Chrono\Process\ProcessExecutorInterface')
$processExecutorMock = $this->getMockBuilder(ProcessExecutorInterface::class)
->getMock();
$processExecutorMock->expects($this->exactly(2))
->method('execute')
Expand Down Expand Up @@ -151,15 +151,15 @@ public function provideTestGetBranches()

$provideTest = array();

$processExecutorMock = $this->getMockBuilder('Accompli\Chrono\Process\ProcessExecutorInterface')
$processExecutorMock = $this->getMockBuilder(ProcessExecutorInterface::class)
->getMock();
$processExecutorMock->expects($this->once())
->method('execute')
->with($this->equalTo($branchesCommand), $this->equalTo(null), $this->equalTo(array('GIT_TERMINAL_PROMPT' => '0', 'GIT_ASKPASS' => 'echo')))
->willReturn(new ProcessExecutionResult(1, '', ''));
$provideTest[] = array($processExecutorMock, array());

$processExecutorMock = $this->getMockBuilder('Accompli\Chrono\Process\ProcessExecutorInterface')
$processExecutorMock = $this->getMockBuilder(ProcessExecutorInterface::class)
->getMock();
$processExecutorMock->expects($this->once())
->method('execute')
Expand All @@ -181,15 +181,15 @@ public function provideTestGetTags()

$provideTest = array();

$processExecutorMock = $this->getMockBuilder('Accompli\Chrono\Process\ProcessExecutorInterface')
$processExecutorMock = $this->getMockBuilder(ProcessExecutorInterface::class)
->getMock();
$processExecutorMock->expects($this->once())
->method('execute')
->with($this->equalTo($tagsCommand), $this->equalTo(null), $this->equalTo(array('GIT_TERMINAL_PROMPT' => '0', 'GIT_ASKPASS' => 'echo')))
->willReturn(new ProcessExecutionResult(1, '', ''));
$provideTest[] = array($processExecutorMock, array());

$processExecutorMock = $this->getMockBuilder('Accompli\Chrono\Process\ProcessExecutorInterface')
$processExecutorMock = $this->getMockBuilder(ProcessExecutorInterface::class)
->getMock();
$processExecutorMock->expects($this->once())
->method('execute')
Expand All @@ -212,7 +212,7 @@ public function provideTestCheckout()

$provideTest = array();

$processExecutorMock = $this->getMockBuilder('Accompli\Chrono\Process\ProcessExecutorInterface')
$processExecutorMock = $this->getMockBuilder(ProcessExecutorInterface::class)
->getMock();
$processExecutorMock->expects($this->once())
->method('isDirectory')
Expand All @@ -223,7 +223,7 @@ public function provideTestCheckout()
->willReturn(new ProcessExecutionResult(1, '', ''));
$provideTest[] = array($processExecutorMock, false);

$processExecutorMock = $this->getMockBuilder('Accompli\Chrono\Process\ProcessExecutorInterface')
$processExecutorMock = $this->getMockBuilder(ProcessExecutorInterface::class)
->getMock();
$processExecutorMock->expects($this->once())
->method('isDirectory')
Expand All @@ -242,7 +242,7 @@ public function provideTestCheckout()
);
$provideTest[] = array($processExecutorMock, false);

$processExecutorMock = $this->getMockBuilder('Accompli\Chrono\Process\ProcessExecutorInterface')
$processExecutorMock = $this->getMockBuilder(ProcessExecutorInterface::class)
->getMock();
$processExecutorMock->expects($this->once())
->method('isDirectory')
Expand All @@ -253,7 +253,7 @@ public function provideTestCheckout()
->willReturn(new ProcessExecutionResult(0, '', ''));
$provideTest[] = array($processExecutorMock, true);

$processExecutorMock = $this->getMockBuilder('Accompli\Chrono\Process\ProcessExecutorInterface')
$processExecutorMock = $this->getMockBuilder(ProcessExecutorInterface::class)
->getMock();
$processExecutorMock->expects($this->once())
->method('isDirectory')
Expand Down
Loading

0 comments on commit 36724ea

Please sign in to comment.