Skip to content

Commit b14abb6

Browse files
authored
Merge pull request #11 from SimonFrings/tests
Clean upt test suite, add .gitattributes to exclude dev files from exports and run tests on PHP 7.4 and simplify test matrix
2 parents e811d77 + 1534a34 commit b14abb6

File tree

8 files changed

+27
-21
lines changed

8 files changed

+27
-21
lines changed

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.gitattributes export-ignore
2+
/.gitignore export-ignore
3+
/.travis.yml export-ignore
4+
/examples/ export-ignore
5+
/phpunit.xml.dist export-ignore
6+
/tests/ export-ignore

.travis.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
language: php
22

3-
php:
4-
# - 5.3 # requires old distro, see below
5-
- 5.4
6-
- 5.5
7-
- 5.6
8-
- 7.0
9-
- 7.1
10-
- 7.2
11-
- 7.3
12-
133
# lock distro so future defaults will not break the build
144
dist: trusty
155

166
matrix:
177
include:
188
- php: 5.3
199
dist: precise
10+
- php: 5.4
11+
- php: 5.5
12+
- php: 5.6
13+
- php: 7.0
14+
- php: 7.1
15+
- php: 7.2
16+
- php: 7.3
17+
- php: 7.4
2018

2119
sudo: false
2220

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"autoload": {
1414
"psr-4" : { "Clue\\React\\Shell\\": "src/" }
1515
},
16+
"autoload-dev": {
17+
"psr-4": { "Clue\\Tests\\React\\Shell\\": "tests/" }
18+
},
1619
"require": {
1720
"php": ">=5.3",
1821
"react/child-process": "^0.5 || ^0.4 || ^0.3",

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="Shell React Test Suite">
116
<directory>./tests/</directory>

tests/DeferredShellTest.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\Shell;
4+
35
use Clue\React\Shell\DeferredShell;
46

57
class DeferredShellTest extends TestCase

tests/FunctionalTest.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\Shell;
4+
35
use React\EventLoop\Factory;
46
use Clue\React\Shell\ProcessLauncher;
57

tests/ProcessLauncherTest.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\Shell;
4+
35
use Clue\React\Shell\ProcessLauncher;
46

57
class ProcessLauncherTest extends TestCase

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

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

3+
namespace Clue\Tests\React\Shell;
4+
35
use React\EventLoop\LoopInterface;
46
use React\Promise\PromiseInterface;
57

6-
require_once __DIR__ . '/../vendor/autoload.php';
7-
8-
error_reporting(-1);
9-
10-
class TestCase extends PHPUnit\Framework\TestCase
8+
class TestCase extends \PHPUnit\Framework\TestCase
119
{
1210
protected function expectCallableOnce()
1311
{

0 commit comments

Comments
 (0)