Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up test suite, add .gitattributes to exclude dev files from exports and run tests on PHP 7.4 and simplify test matrix #93

Merged
merged 3 commits into from
May 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/examples/ export-ignore
/phpunit.xml.dist export-ignore
/tests/ export-ignore
22 changes: 10 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
language: php

php:
# - 5.3 # requires old distro, see below
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- hhvm # ignore errors, see below

# lock distro so future defaults will not break the build
dist: trusty

matrix:
include:
- php: 5.3
dist: precise
- php: 5.4
- php: 5.5
- php: 5.6
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
- php: hhvm-3.18
allow_failures:
- php: hhvm
- php: hhvm-3.18

sudo: false

Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"autoload": {
"psr-4": { "Clue\\React\\Stdio\\": "src/" }
},
"autoload-dev": {
"psr-4": { "Clue\\Tests\\React\\Stdio\\": "tests/" }
},
"require-dev": {
"clue/arguments": "^2.0",
"clue/commander": "^1.2",
Expand Down
7 changes: 1 addition & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
>
<phpunit bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="Stdio React Test Suite">
<directory>./tests/</directory>
Expand Down
2 changes: 2 additions & 0 deletions tests/FunctionalExampleTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\React\Stdio;

class FunctionalExampleTest extends TestCase
{
public function testPeriodicExampleWithPipedInputEndsBecauseInputEnds()
Expand Down
2 changes: 2 additions & 0 deletions tests/ReadlineTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\React\Stdio;

use Clue\React\Stdio\Readline;
use React\Stream\ThroughStream;
use Evenement\EventEmitter;
Expand Down
2 changes: 2 additions & 0 deletions tests/StdioTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\React\Stdio;

use Clue\React\Stdio\Stdio;
use Clue\React\Stdio\Readline;
use React\EventLoop\Factory;
Expand Down
11 changes: 3 additions & 8 deletions tests/bootstrap.php → tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\React\Stdio;

use PHPUnit\Framework\TestCase as BaseTestCase;

require_once __DIR__ . '/../vendor/autoload.php';
Expand Down Expand Up @@ -44,7 +46,7 @@ protected function expectCallableOnceWith($value)
*/
protected function createCallableMock()
{
return $this->getMockBuilder('CallableStub')->getMock();
return $this->getMockBuilder('stdClass')->setMethods(array('__invoke'))->getMock();
}

protected function expectPromiseResolve($promise)
Expand All @@ -65,10 +67,3 @@ protected function expectPromiseReject($promise)
return $promise;
}
}

class CallableStub
{
public function __invoke()
{
}
}