Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/rename'
Browse files Browse the repository at this point in the history
  • Loading branch information
holyshared committed Dec 5, 2015
2 parents 8e971ee + 3cfe852 commit 1dddc8e
Show file tree
Hide file tree
Showing 24 changed files with 184 additions and 184 deletions.
4 changes: 2 additions & 2 deletions spec/CoverallsReportTransfer.spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
'TRAVIS_JOB_ID' => '10',
'COVERALLS_REPO_TOKEN' => 'token'
]);
$adaptor = new TravisCI($environment);
$service = new CIService($adaptor);
$adapter = new TravisCI($environment);
$service = new CIService($adapter);

$this->report = new CoverallsReport([
'name' => __DIR__ . '/fixtures/coveralls.json',
Expand Down
14 changes: 7 additions & 7 deletions spec/entity/CIService.spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@

use coverallskit\entity\CIService;
use coverallskit\Environment;
use coverallskit\environment\EnvironmentAdaptor;
use coverallskit\environment\EnvironmentAdapter;
use Prophecy\Prophet;

describe(CIService::class, function () {
beforeEach(function () {
$this->prophet = new Prophet();

$adaptor = $this->prophet->prophesize(EnvironmentAdaptor::class);
$adaptor->getName()->willReturn('travis-ci');
$adaptor->getBuildJobId()->willReturn('10');
$adaptor->getCoverallsToken()->willReturn('token');
$adaptor->isSupported()->willReturn(true);
$adapter = $this->prophet->prophesize(EnvironmentAdapter::class);
$adapter->getName()->willReturn('travis-ci');
$adapter->getBuildJobId()->willReturn('10');
$adapter->getCoverallsToken()->willReturn('token');
$adapter->isSupported()->willReturn(true);

$this->service = new CIService($adaptor->reveal());
$this->service = new CIService($adapter->reveal());
});
describe('getServiceName', function () {
it('return service name', function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
namespace coverallskit\spec;

use coverallskit\Environment;
use coverallskit\environment\AdaptorResolver;
use coverallskit\environment\AdapterResolver;
use coverallskit\environment\CircleCI;
use coverallskit\environment\CodeShip;
use coverallskit\environment\DroneIO;
use coverallskit\environment\General;
use coverallskit\environment\Jenkins;
use coverallskit\environment\TravisCI;
use coverallskit\exception\EnvironmentAdaptorNotFoundException;
use coverallskit\exception\EnvironmentAdapterNotFoundException;

describe(AdaptorResolver::class, function () {
describe(AdapterResolver::class, function () {
describe('#resolveByEnvironment', function () {
context('when supported', function () {
context('when circle-ci', function () {
Expand All @@ -31,11 +31,11 @@
'CIRCLE_BUILD_NUM' => '10',
'COVERALLS_REPO_TOKEN' => 'token'
]);
$this->resolver = new AdaptorResolver($environment);
$this->resolver = new AdapterResolver($environment);
});
it('return detect circle-ci adaptor', function () {
$adaptor = $this->resolver->resolveByEnvironment();
expect($adaptor)->toBeAnInstanceOf(CircleCI::class);
it('return detect circle-ci adapter', function () {
$adapter = $this->resolver->resolveByEnvironment();
expect($adapter)->toBeAnInstanceOf(CircleCI::class);
});
});
context('when drone.io', function () {
Expand All @@ -46,11 +46,11 @@
'DRONE_BUILD_NUMBER' => '10',
'COVERALLS_REPO_TOKEN' => 'token'
]);
$this->resolver = new AdaptorResolver($environment);
$this->resolver = new AdapterResolver($environment);
});
it('return detect drone.io adaptor', function () {
$adaptor = $this->resolver->resolveByEnvironment();
expect($adaptor)->toBeAnInstanceOf(DroneIO::class);
it('return detect drone.io adapter', function () {
$adapter = $this->resolver->resolveByEnvironment();
expect($adapter)->toBeAnInstanceOf(DroneIO::class);
});
});
context('when travis-ci', function () {
Expand All @@ -61,11 +61,11 @@
'TRAVIS_JOB_ID' => '10',
'COVERALLS_REPO_TOKEN' => 'token'
]);
$this->resolver = new AdaptorResolver($environment);
$this->resolver = new AdapterResolver($environment);
});
it('return detect travis-ci adaptor', function () {
$adaptor = $this->resolver->resolveByEnvironment();
expect($adaptor)->toBeAnInstanceOf(TravisCI::class);
it('return detect travis-ci adapter', function () {
$adapter = $this->resolver->resolveByEnvironment();
expect($adapter)->toBeAnInstanceOf(TravisCI::class);
});
});
context('when codeship', function () {
Expand All @@ -76,11 +76,11 @@
'CI_BUILD_NUMBER' => '10',
'COVERALLS_REPO_TOKEN' => 'token'
]);
$this->resolver = new AdaptorResolver($environment);
$this->resolver = new AdapterResolver($environment);
});
it('return detect codeship adaptor', function () {
$adaptor = $this->resolver->resolveByEnvironment();
expect($adaptor)->toBeAnInstanceOf(CodeShip::class);
it('return detect codeship adapter', function () {
$adapter = $this->resolver->resolveByEnvironment();
expect($adapter)->toBeAnInstanceOf(CodeShip::class);
});
});
context('when jenkins', function () {
Expand All @@ -89,41 +89,41 @@
'BUILD_NUMBER' => '10',
'JENKINS_URL' => 'http://example.com'
]);
$this->resolver = new AdaptorResolver($environment);
$this->resolver = new AdapterResolver($environment);
});
it('return detect jenkins adaptor', function () {
$adaptor = $this->resolver->resolveByEnvironment();
expect($adaptor)->toBeAnInstanceOf(Jenkins::class);
it('return detect jenkins adapter', function () {
$adapter = $this->resolver->resolveByEnvironment();
expect($adapter)->toBeAnInstanceOf(Jenkins::class);
});
});
});
context('when not supported', function () {
beforeEach(function () {
$environment = new Environment([]);
$this->resolver = new AdaptorResolver($environment);
$this->resolver = new AdapterResolver($environment);
});
it('return general adaptor', function () {
$adaptor = $this->resolver->resolveByEnvironment();
expect($adaptor)->toBeAnInstanceOf(General::class);
it('return general adapter', function () {
$adapter = $this->resolver->resolveByEnvironment();
expect($adapter)->toBeAnInstanceOf(General::class);
});
});
});
describe('#resolveByName', function () {
beforeEach(function () {
$environment = new Environment([]);
$this->detector = new AdaptorResolver($environment);
$this->detector = new AdapterResolver($environment);
});
context('when supported', function () {
it('return detect adaptor', function () {
$adaptor = $this->resolver->resolveByName('circle-ci');
expect($adaptor)->toBeAnInstanceOf(CircleCI::class);
it('return detect adapter', function () {
$adapter = $this->resolver->resolveByName('circle-ci');
expect($adapter)->toBeAnInstanceOf(CircleCI::class);
});
});
context('when not supported', function () {
it('throw \coverallskit\exception\EnvironmentAdaptorNotFoundException exception', function () {
it('throw \coverallskit\exception\EnvironmentAdapterNotFoundException exception', function () {
expect(function () {
$this->resolver->resolveByName('not_found');
})->toThrow(EnvironmentAdaptorNotFoundException::class);
})->toThrow(EnvironmentAdapterNotFoundException::class);
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion spec/environment/CircleCI.spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

describe(CircleCI::class, function () {
describe('#getName', function () {
it('return adaptor name', function () {
it('return adapter name', function () {
$this->circleCI = new CircleCI(new Environment());
expect($this->circleCI->getName())->toBe('circle-ci');
});
Expand Down
2 changes: 1 addition & 1 deletion spec/environment/CodeShip.spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

describe(CodeShip::class, function () {
describe('#getName', function () {
it('return adaptor name', function () {
it('return adapter name', function () {
$this->codeship = new CodeShip(new Environment());
expect($this->codeship->getName())->toBe('codeship');
});
Expand Down
2 changes: 1 addition & 1 deletion spec/environment/DroneIO.spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

describe(DroneIO::class, function () {
describe('#getName', function () {
it('return adaptor name', function () {
it('return adapter name', function () {
$this->drone = new DroneIO(new Environment());
expect($this->drone->getName())->toBe('drone.io');
});
Expand Down
2 changes: 1 addition & 1 deletion spec/environment/General.spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

describe(General::class, function () {
describe('#getName', function () {
it('return adaptor name', function () {
it('return adapter name', function () {
$this->general = new General(new Environment());
expect($this->general->getName())->toBe('');
});
Expand Down
2 changes: 1 addition & 1 deletion spec/environment/Jenkins.spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

describe(Jenkins::class, function () {
describe('#getName', function () {
it('return adaptor name', function () {
it('return adapter name', function () {
$this->jenkins = new Jenkins(new Environment());
expect($this->jenkins->getName())->toBe('jenkins');
});
Expand Down
2 changes: 1 addition & 1 deletion spec/environment/TravisCI.spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

describe(TravisCI::class, function () {
describe('#getName', function () {
it('return adaptor name', function () {
it('return adapter name', function () {
$this->travis = new TravisCI(new Environment());
expect($this->travis->getName())->toBe('travis-ci');
});
Expand Down
6 changes: 3 additions & 3 deletions src/configuration/Basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use coverallskit\entity\CIService;
use coverallskit\entity\GitRepository;
use coverallskit\Environment;
use coverallskit\environment\AdaptorResolver;
use coverallskit\environment\AdapterResolver;
use coverallskit\ReportBuilder;
use Eloquent\Pathogen\AbsolutePath;
use Zend\Config\Config;
Expand All @@ -28,7 +28,7 @@ class Basic extends AbstractConfiguration
const REPOSITORY_DIRECTORY_KEY = 'repositoryDirectory';

/**
* @var \coverallskit\environment\AdaptorResolver
* @var \coverallskit\environment\AdapterResolver
*/
private $adaptorResolver;

Expand All @@ -38,7 +38,7 @@ class Basic extends AbstractConfiguration
*/
public function __construct(Config $config, AbsolutePath $rootPath)
{
$this->adaptorResolver = new AdaptorResolver(new Environment($_SERVER));
$this->adaptorResolver = new AdapterResolver(new Environment($_SERVER));

parent::__construct($config, $rootPath);
}
Expand Down
8 changes: 4 additions & 4 deletions src/entity/CIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace coverallskit\entity;

use coverallskit\AttributePopulatable;
use coverallskit\environment\EnvironmentAdaptor;
use coverallskit\environment\EnvironmentAdapter;

/**
* Class CIService
Expand All @@ -21,14 +21,14 @@ class CIService implements ServiceEntity
use AttributePopulatable;

/**
* @var \coverallskit\environment\EnvironmentAdaptor
* @var \coverallskit\environment\EnvironmentAdapter
*/
protected $adaptor;

/**
* @param EnvironmentAdaptor $adaptor
* @param EnvironmentAdapter $adaptor
*/
public function __construct(EnvironmentAdaptor $adaptor)
public function __construct(EnvironmentAdapter $adaptor)
{
$this->adaptor = $adaptor;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
use coverallskit\Environment;

/**
* Class AbstractAdaptor
* Class AbstractAdapter
*/
abstract class AbstractAdaptor implements EnvironmentAdaptor
abstract class AbstractAdapter implements EnvironmentAdapter
{
/**
* @var \coverallskit\Environment
Expand Down
Loading

0 comments on commit 1dddc8e

Please sign in to comment.