Skip to content

Commit 27dc07f

Browse files
authored
Merge pull request #2 from phphd/refactor-tests
Relocate Tests
2 parents 6f71165 + 16930b4 commit 27dc07f

File tree

9 files changed

+24
-19
lines changed

9 files changed

+24
-19
lines changed

.gitattributes

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
/**/.gitignore export-ignore
2+
/**/.gitattributes export-ignore
3+
/**/Tests export-ignore
4+
/**/*Test.php export-ignore
15
/.github export-ignore
2-
/.gitattributes export-ignore
3-
/.gitignore export-ignore
4-
/tests export-ignore
5-
/ecs.php export-ignore
66
/phpstan.dist.neon export-ignore
77
/phpunit.xml.dist export-ignore
8+
/ecs.php export-ignore
89
/rector.php export-ignore

ecs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
return static function (ECSConfig $ecsConfig): void {
99
$ecsConfig->sets([PhdSetList::ecs()->getPath()]);
1010

11-
$ecsConfig->paths([__DIR__.'/src', __DIR__.'/tests']);
11+
$ecsConfig->paths([__DIR__.'/src']);
1212
$ecsConfig->skip([__DIR__.'/vendor']);
1313
};

phpstan.dist.neon

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
includes:
22
- vendor/phpstan/phpstan-strict-rules/rules.neon
3+
- vendor/tomasvotruba/type-coverage/config/extension.neon
34
- vendor/phpstan/phpstan-phpunit/extension.neon
45
- vendor/phpstan/phpstan-phpunit/rules.neon
5-
- vendor/tomasvotruba/type-coverage/config/extension.neon
66

77
parameters:
8-
level: 9
9-
phpVersion: 80127
8+
level: max
9+
phpVersion:
10+
min: 80100
11+
max: 80599
1012
editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'
1113
paths:
1214
- src
13-
- tests
1415
fileExtensions:
1516
- 'php'
1617
type_coverage:

phpunit.xml.dist

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
failOnWarning="true">
1111
<testsuites>
1212
<testsuite name="Unit">
13-
<directory suffix="UnitTest.php">tests</directory>
13+
<directory suffix="UnitTest.php">src</directory>
1414
</testsuite>
1515
<testsuite name="Integration">
16-
<directory suffix="IntegrationTest.php">tests</directory>
16+
<directory suffix="ServiceTest.php">src</directory>
1717
</testsuite>
1818
</testsuites>
1919

@@ -22,6 +22,7 @@
2222
<directory>src</directory>
2323
</include>
2424
<exclude>
25+
<directory>src/*/Tests</directory>
2526
<directory>src/*/*/Tests</directory>
2627
<directory>src/*/*/*/Tests</directory>
2728
<directory suffix="Test.php">src</directory>

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Rector\ValueObject\PhpVersion;
88

99
return static function (RectorConfig $rectorConfig): void {
10-
$rectorConfig->paths([__DIR__.'/src', __DIR__.'/tests']);
10+
$rectorConfig->paths([__DIR__.'/src']);
1111

1212
$rectorConfig->sets([PhdSetList::rector()->getPath()]);
1313
$rectorConfig->phpVersion(PhpVersion::PHP_81);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
declare(strict_types=1);
44

5-
namespace PhPhD\ExceptionToolkit\Tests\Bundle;
5+
namespace PhPhD\ExceptionToolkit\Bundle\Tests;
66

77
use Nyholm\BundleTest\TestKernel;
88
use PhPhD\ExceptionToolkit\Bundle\PhdExceptionToolkitBundle;
9-
use PhPhD\ExceptionToolkit\Tests\Bundle\Compiler\TestServicesCompilerPass;
9+
use PhPhD\ExceptionToolkit\Bundle\Tests\Compiler\TestServicesCompilerPass;
1010
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
1111
use Symfony\Component\HttpKernel\KernelInterface;
1212

tests/Bundle/Compiler/TestServicesCompilerPass.php renamed to src/Bundle/Tests/Compiler/TestServicesCompilerPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace PhPhD\ExceptionToolkit\Tests\Bundle\Compiler;
5+
namespace PhPhD\ExceptionToolkit\Bundle\Tests\Compiler;
66

77
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
88
use Symfony\Component\DependencyInjection\ContainerBuilder;

tests/Bundle/DependencyInjectionIntegrationTest.php renamed to src/Unwrapper/Tests/ExceptionUnwrapperServiceTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
declare(strict_types=1);
44

5-
namespace PhPhD\ExceptionToolkit\Tests\Bundle;
5+
namespace PhPhD\ExceptionToolkit\Unwrapper\Tests;
66

7+
use PhPhD\ExceptionToolkit\Bundle\Tests\BundleTestCase;
78
use PhPhD\ExceptionToolkit\Unwrapper\Amp\AmpExceptionUnwrapper;
9+
use PhPhD\ExceptionToolkit\Unwrapper\ExceptionUnwrapper;
810
use PhPhD\ExceptionToolkit\Unwrapper\Messenger\MessengerExceptionUnwrapper;
911
use Symfony\Component\VarExporter\LazyObjectInterface;
1012

@@ -14,7 +16,7 @@
1416
*
1517
* @internal
1618
*/
17-
final class DependencyInjectionIntegrationTest extends BundleTestCase
19+
final class ExceptionUnwrapperServiceTest extends BundleTestCase
1820
{
1921
public function testServiceDefinitions(): void
2022
{
@@ -30,7 +32,7 @@ private function checkExceptionUnwrapper(): void
3032

3133
private function checkTopmostUnwrapper(): void
3234
{
33-
$exceptionUnwrapper = self::getContainer()->get('phd_exception_toolkit.exception_unwrapper');
35+
$exceptionUnwrapper = self::getContainer()->get(ExceptionUnwrapper::class);
3436
self::assertInstanceOf(LazyObjectInterface::class, $exceptionUnwrapper);
3537
self::assertFalse($exceptionUnwrapper->isLazyObjectInitialized());
3638
$topmostUnwrapper = $exceptionUnwrapper->initializeLazyObject();

tests/Unwrapper/ExceptionUnwrapperUnitTest.php renamed to src/Unwrapper/Tests/ExceptionUnwrapperUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace PhPhD\ExceptionToolkit\Tests\Unwrapper;
5+
namespace PhPhD\ExceptionToolkit\Unwrapper\Tests;
66

77
use Amp\CompositeException;
88
use Exception;

0 commit comments

Comments
 (0)