Skip to content

Commit

Permalink
Enhancement: Split auto review tests from unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Aug 6, 2018
1 parent 7a70d1f commit ff10634
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 7 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
- if [[ "$WITH_HIGHEST" == "true" ]]; then composer update; fi

script:
- vendor/bin/phpunit --configuration=test/AutoReview/phpunit.xml
- if [[ "$WITH_COVERAGE" == "true" ]]; then xdebug-enable; fi
- if [[ "$WITH_COVERAGE" == "true" ]]; then vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-clover=build/logs/clover.xml; else vendor/bin/phpunit --configuration=test/Unit/phpunit.xml; fi
- if [[ "$WITH_COVERAGE" == "true" ]]; then xdebug-disable; fi
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ infection: vendor
vendor/bin/infection --min-covered-msi=80 --min-msi=80

test: vendor
vendor/bin/phpunit --configuration=test/AutoReview/phpunit.xml
vendor/bin/phpunit --configuration=test/Unit/phpunit.xml

vendor: composer.json composer.lock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
* @see https://github.com/localheinz/json-printer
*/

namespace Localheinz\Json\Printer\Test\Unit;
namespace Localheinz\Json\Printer\Test\AutoReview;

use Localheinz\Test\Util\Helper;
use PHPUnit\Framework;

/**
* @internal
*/
final class ProjectCodeTest extends Framework\TestCase
final class SrcCodeTest extends Framework\TestCase
{
use Helper;

Expand All @@ -36,9 +36,4 @@ public function testProductionClassesHaveTests()
'Localheinz\\Json\\Printer\\Test\\Unit\\'
);
}

public function testTestClassesAreAbstractOrFinal()
{
$this->assertClassesAreAbstractOrFinal(__DIR__ . '/..');
}
}
30 changes: 30 additions & 0 deletions test/AutoReview/TestCodeTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

/**
* Copyright (c) 2018 Andreas Möller.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*
* @see https://github.com/localheinz/json-printer
*/

namespace Localheinz\Json\Printer\Test\AutoReview;

use Localheinz\Test\Util\Helper;
use PHPUnit\Framework;

/**
* @internal
*/
final class TestCodeTest extends Framework\TestCase
{
use Helper;

public function testTestClassesAreAbstractOrFinal()
{
$this->assertClassesAreAbstractOrFinal(__DIR__ . '/..');
}
}
27 changes: 27 additions & 0 deletions test/AutoReview/phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd"
beStrictAboutChangesToGlobalState="true"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutResourceUsageDuringSmallTests="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutTodoAnnotatedTests="true"
bootstrap="../../vendor/autoload.php"
colors="true"
columns="max"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="true"
>
<testsuites>
<testsuite name="AutoReview Tests">
<directory>.</directory>
</testsuite>
</testsuites>
</phpunit>

0 comments on commit ff10634

Please sign in to comment.