Skip to content

Commit 3f476ca

Browse files
committed
Clean up test suite
1 parent a4ce55f commit 3f476ca

File tree

6 files changed

+13
-14
lines changed

6 files changed

+13
-14
lines changed

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
"autoload": {
2424
"psr-4": { "Clue\\React\\Stdio\\": "src/" }
2525
},
26+
"autoload-dev": {
27+
"psr-4": { "Clue\\Tests\\React\\Stdio\\": "tests/" }
28+
},
2629
"require-dev": {
2730
"clue/arguments": "^2.0",
2831
"clue/commander": "^1.2",

phpunit.xml.dist

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<phpunit bootstrap="tests/bootstrap.php"
4-
colors="true"
5-
convertErrorsToExceptions="true"
6-
convertNoticesToExceptions="true"
7-
convertWarningsToExceptions="true"
8-
>
3+
<phpunit bootstrap="vendor/autoload.php" colors="true">
94
<testsuites>
105
<testsuite name="Stdio React Test Suite">
116
<directory>./tests/</directory>

tests/FunctionalExampleTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
namespace Clue\Tests\React\Stdio;
4+
35
class FunctionalExampleTest extends TestCase
46
{
57
public function testPeriodicExampleWithPipedInputEndsBecauseInputEnds()

tests/ReadlineTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
namespace Clue\Tests\React\Stdio;
4+
35
use Clue\React\Stdio\Readline;
46
use React\Stream\ThroughStream;
57
use Evenement\EventEmitter;

tests/StdioTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
namespace Clue\Tests\React\Stdio;
4+
35
use Clue\React\Stdio\Stdio;
46
use Clue\React\Stdio\Readline;
57
use React\EventLoop\Factory;

tests/bootstrap.php renamed to tests/TestCase.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
namespace Clue\Tests\React\Stdio;
4+
35
use PHPUnit\Framework\TestCase as BaseTestCase;
46

57
require_once __DIR__ . '/../vendor/autoload.php';
@@ -44,7 +46,7 @@ protected function expectCallableOnceWith($value)
4446
*/
4547
protected function createCallableMock()
4648
{
47-
return $this->getMockBuilder('CallableStub')->getMock();
49+
return $this->getMockBuilder('stdClass')->setMethods(array('__invoke'))->getMock();
4850
}
4951

5052
protected function expectPromiseResolve($promise)
@@ -65,10 +67,3 @@ protected function expectPromiseReject($promise)
6567
return $promise;
6668
}
6769
}
68-
69-
class CallableStub
70-
{
71-
public function __invoke()
72-
{
73-
}
74-
}

0 commit comments

Comments
 (0)