-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ivan Wolf
committed
Jun 6, 2018
1 parent
50d145c
commit b166226
Showing
14 changed files
with
104 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
src_dir: src | ||
service_name: travis-ci | ||
coverage_clover: build/clover.xml | ||
json_path: build/coveralls-upload.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,32 @@ | ||
language: php | ||
|
||
php: | ||
- 7.1 | ||
- 7.2 | ||
env: | ||
global: | ||
- COMPOSER_ARGS="--no-interaction" | ||
- COVERAGE_DEPS="php-coveralls/php-coveralls" | ||
|
||
before_script: | ||
- composer self-update | ||
- composer install --dev --prefer-source --no-interaction | ||
matrix: | ||
include: | ||
- php: 7.1 | ||
env: | ||
- CS_CHECK=true | ||
- MD_CHECK=true | ||
- TEST_COVERAGE=true | ||
- php: 7.2 | ||
|
||
before_install: | ||
# - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi | ||
- cp phpunit.xml.dist phpunit.xml | ||
|
||
install: | ||
- travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs | ||
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi | ||
- stty cols 120 && composer show | ||
|
||
script: | ||
- php vendor/bin/phpunit -c travis.phpunit.xml | ||
- php vendor/bin/phpmd src xml build/config/phpmd.xml --reportfile build/logs/pmd.xml | ||
- php vendor/bin/phpcs --report=checkstyle --report-file=build/logs/checkstyle.xml --standard=build/config/phpcs.xml -v ./src/ ./tests/ | ||
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi | ||
- if [[ $MD_CHECK == 'true' ]]; then composer md-check ; fi | ||
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage-clover ; else composer test ; fi | ||
|
||
after_script: | ||
- php vendor/bin/coveralls | ||
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry php vendor/bin/php-coveralls -v ; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
* | ||
!config | ||
!config/* | ||
!logs | ||
!.gitignore |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="DETAIL NET PHPCS rule set"> | ||
<description>The coding standard for a DETAIL NET PHP application</description> | ||
|
||
<!-- Include the whole PSR-2 standard --> | ||
<rule ref="PSR2"/> | ||
<rule ref="Generic.Files.LineLength"> | ||
<properties> | ||
<property name="lineLimit" value="140"/> | ||
<property name="absoluteLineLimit" value="0"/> | ||
</properties> | ||
</rule> | ||
|
||
<!-- Paths to check --> | ||
<file>src</file> | ||
<file>tests</file> | ||
</ruleset> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,15 @@ | ||
<phpunit | ||
bootstrap="./tests/bootstrap.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
verbose="true" | ||
stopOnFailure="false" | ||
processIsolation="false" | ||
backupGlobals="false" | ||
> | ||
<phpunit bootstrap="./vendor/autoload.php" colors="true"> | ||
<testsuite name="Detail\Normalization Test Suite"> | ||
<directory>./tests</directory> | ||
</testsuite> | ||
|
||
<filter> | ||
<whitelist> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">./src</directory> | ||
</whitelist> | ||
</filter> | ||
|
||
<logging> | ||
<log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/> | ||
<log type="coverage-html" target="./build/coverage" lowUpperBound="35" highLowerBound="70"/> | ||
<log type="coverage-clover" target="./build/logs/clover.xml"/> | ||
<log type="junit" target="./build/logs/junit.xml"/> | ||
</logging> | ||
</phpunit> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace DetailTest\Normalization\Normalizer; | ||
|
||
use PHPUnit\Framework\MockObject\MockObject; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
use Detail\Normalization\Normalizer\NormalizerAwareTrait; | ||
use Detail\Normalization\Normalizer\NormalizerInterface; | ||
|
||
class NormalizerAwareTraitTest extends TestCase | ||
{ | ||
/** | ||
* @var MockObject | ||
*/ | ||
private $normalizer; | ||
|
||
protected function setUp() | ||
{ | ||
$this->normalizer = $this->getMockBuilder(NormalizerInterface::CLASS)->getMock(); | ||
} | ||
|
||
public function testSetsNormalizer(): void | ||
{ | ||
/** @var NormalizerInterface $normalizer */ | ||
$normalizer = $this->getNormalizer(); | ||
|
||
/** @var NormalizerAwareTrait $object */ | ||
$object = $this->getMockBuilder(NormalizerAwareTrait::CLASS)->getMockForTrait(); | ||
|
||
$this->assertNull($object->getNormalizer()); | ||
|
||
$object->setNormalizer($normalizer); | ||
|
||
$this->assertEquals($normalizer, $object->getNormalizer()); | ||
} | ||
|
||
private function getNormalizer(): MockObject | ||
{ | ||
return $this->normalizer; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.