Skip to content

Commit 3025199

Browse files
committed
Simplify test bootstrapping logic via Composer
1 parent 414ee7b commit 3025199

4 files changed

Lines changed: 14 additions & 11 deletions

File tree

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
"psr-4": { "React\\Promise\\Stream\\" : "src/" },
1515
"files": [ "src/functions_include.php" ]
1616
},
17+
"autoload-dev": {
18+
"psr-4": { "React\\Tests\\Promise\\Stream\\": "tests/" }
19+
},
1720
"require": {
1821
"php": ">=5.3",
1922
"react/stream": "^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4 || ^0.3",

phpunit.xml.dist

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

3-
<phpunit bootstrap="tests/bootstrap.php"
3+
<phpunit bootstrap="vendor/autoload.php"
44
colors="true"
55
convertErrorsToExceptions="true"
66
convertNoticesToExceptions="true"

tests/CallableStub.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace React\Tests\Promise\Stream;
4+
5+
class CallableStub
6+
{
7+
public function __invoke()
8+
{
9+
}
10+
}
Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace React\Tests\Promise\Stream;
44

5-
require_once __DIR__ . '/../vendor/autoload.php';
6-
75
class TestCase extends \PHPUnit_Framework_TestCase
86
{
97
protected function expectCallableOnce()
@@ -83,11 +81,3 @@ protected function expectPromiseReject($promise)
8381
return $promise;
8482
}
8583
}
86-
87-
class CallableStub
88-
{
89-
public function __invoke()
90-
{
91-
}
92-
}
93-

0 commit comments

Comments
 (0)