Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Split auto review tests from unit tests #35

Merged
merged 1 commit into from
Aug 6, 2018
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
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>