Skip to content

Commit 9420847

Browse files
committed
test: Separate Unit tests
1 parent aca7e3d commit 9420847

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+102
-394
lines changed

composer.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@
5454
"tests/fixtures/",
5555
"tests/"
5656
]
57-
},
58-
"files": [
59-
"tests/Fiber.php"
60-
]
57+
}
6158
},
6259
"config": {
6360
"audit": {
@@ -69,6 +66,7 @@
6966
"cs:fix": "php-cs-fixer fix -v",
7067
"stan": "phpstan",
7168
"test": "phpunit --color=always --testdox",
69+
"test:unit": "phpunit --color=always --testdox --testsuite=Unit",
7270
"refactor": "rector process --config=rector.php",
7371
"test:cc": [
7472
"@putenv XDEBUG_MODE=coverage",

phpunit.xml.dist

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
<!-- PHPUnit configuration file with new format for PHPUnit 9.6+ -->
44
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
5+
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
66
bootstrap="vendor/autoload.php"
7-
cacheResult="false"
7+
cacheResultFile="runtime/phpunit/result.cache"
88
colors="true"
99
convertDeprecationsToExceptions="true">
1010
<testsuites>
11-
<testsuite name="Promise Test Suite">
12-
<directory>./tests/</directory>
13-
<directory suffix=".phpt">./tests/</directory>
11+
<testsuite name="Feature">
12+
<directory suffix=".phpt">./tests/Feature</directory>
13+
</testsuite>
14+
<testsuite name="Unit">
15+
<directory>./tests/Unit</directory>
1416
</testsuite>
1517
</testsuites>
1618
<coverage>

tests/Fiber.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

tests/DeferredTest.php renamed to tests/Unit/DeferredTest.php

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

33
declare(strict_types=1);
44

5-
namespace React\Promise;
5+
namespace React\Promise\Unit;
66

7-
use React\Promise\PromiseAdapter\CallbackPromiseAdapter;
7+
use React\Promise\Deferred;
8+
use React\Promise\Unit\PromiseAdapter\CallbackPromiseAdapter;
89

910
/**
1011
* @template T

tests/fixtures/CallbackWithDNFTypehintClass.php renamed to tests/Unit/Fixture/CallbackWithDNFTypehintClass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace React\Promise;
3+
namespace React\Promise\Unit\Fixture;
44

55
class CallbackWithDNFTypehintClass
66
{

tests/fixtures/CallbackWithIntersectionTypehintClass.php renamed to tests/Unit/Fixture/CallbackWithIntersectionTypehintClass.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 React\Promise;
5+
namespace React\Promise\Unit\Fixture;
66

77
class CallbackWithIntersectionTypehintClass
88
{

tests/fixtures/CallbackWithTypehintClass.php renamed to tests/Unit/Fixture/CallbackWithTypehintClass.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 React\Promise;
5+
namespace React\Promise\Unit\Fixture;
66

77
class CallbackWithTypehintClass
88
{

tests/fixtures/CallbackWithUnionTypehintClass.php renamed to tests/Unit/Fixture/CallbackWithUnionTypehintClass.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 React\Promise;
5+
namespace React\Promise\Unit\Fixture;
66

77
class CallbackWithUnionTypehintClass
88
{

tests/fixtures/CallbackWithoutTypehintClass.php renamed to tests/Unit/Fixture/CallbackWithoutTypehintClass.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 React\Promise;
5+
namespace React\Promise\Unit\Fixture;
66

77
class CallbackWithoutTypehintClass
88
{

tests/fixtures/CountableException.php renamed to tests/Unit/Fixture/CountableException.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 React\Promise;
5+
namespace React\Promise\Unit\Fixture;
66

77
class CountableException extends \RuntimeException implements \Countable
88
{

0 commit comments

Comments
 (0)