Skip to content

Commit

Permalink
Simplify test bootstrapping logic via Composer
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Dec 21, 2017
1 parent 414ee7b commit 3025199
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"psr-4": { "React\\Promise\\Stream\\" : "src/" },
"files": [ "src/functions_include.php" ]
},
"autoload-dev": {
"psr-4": { "React\\Tests\\Promise\\Stream\\": "tests/" }
},
"require": {
"php": ">=5.3",
"react/stream": "^1.0 || ^0.7 || ^0.6 || ^0.5 || ^0.4 || ^0.3",
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="tests/bootstrap.php"
<phpunit bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
Expand Down
10 changes: 10 additions & 0 deletions tests/CallableStub.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace React\Tests\Promise\Stream;

class CallableStub
{
public function __invoke()
{
}
}
10 changes: 0 additions & 10 deletions tests/bootstrap.php → tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace React\Tests\Promise\Stream;

require_once __DIR__ . '/../vendor/autoload.php';

class TestCase extends \PHPUnit_Framework_TestCase
{
protected function expectCallableOnce()
Expand Down Expand Up @@ -83,11 +81,3 @@ protected function expectPromiseReject($promise)
return $promise;
}
}

class CallableStub
{
public function __invoke()
{
}
}

0 comments on commit 3025199

Please sign in to comment.