Skip to content

Commit 7ca296d

Browse files
authored
Merge pull request #11 from SimonFrings/tests
Clean up test suite, add .gitattributes to exclude dev files from exports and run tests on PHP 7.4 and simplify test matrix
2 parents a0d51f6 + f2db88d commit 7ca296d

File tree

6 files changed

+26
-20
lines changed

6 files changed

+26
-20
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: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
language: php
2-
php:
3-
# - 5.3 # requires old distro, see below
4-
- 5.4
5-
- 5.5
6-
- 5.6
7-
- 7.0
8-
- 7.1
9-
- 7.2
10-
- hhvm # ignore errors, see below
112

123
# lock distro so future defaults will not break the build
134
dist: trusty
@@ -16,8 +7,17 @@ matrix:
167
include:
178
- php: 5.3
189
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
18+
- php: hhvm-3.18
1919
allow_failures:
20-
- php: hhvm
20+
- php: hhvm-3.18
2121

2222
sudo: false
2323

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@
1313
"autoload": {
1414
"psr-4": { "Clue\\React\\Ssdp\\": "src/" }
1515
},
16+
"autoload-dev": {
17+
"psr-4": { "Clue\\Tests\\React\\Ssdp\\": "tests/" }
18+
},
1619
"require": {
1720
"php": ">=5.3",
1821
"clue/multicast-react": "^1.0 || ^0.2",
1922
"react/event-loop": "^1.0 || ^0.5 || ^0.4 || ^0.3",
2023
"react/promise": "^2.0 || ^1.0"
2124
},
2225
"require-dev": {
23-
"phpunit/phpunit": "^6.0 || ^5.7 || ^4.8.35"
26+
"phpunit/phpunit": "^7.0 ||^6.0 || ^5.7 || ^4.8.35"
2427
}
2528
}

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

tests/ClientTest.php

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

3+
namespace Clue\Tests\React\Ssdp;
4+
35
use Clue\React\Ssdp\Client;
46
use React\EventLoop\Factory;
57

@@ -37,7 +39,7 @@ interface_exists('React\EventLoop\TimerInterface') ? 'React\EventLoop\TimerInter
3739

3840
$this->assertInstanceOf('React\Promise\PromiseInterface', $promise);
3941

40-
if (!($promise instanceof React\Promise\CancellablePromiseInterface)) {
42+
if (!($promise instanceof \React\Promise\CancellablePromiseInterface)) {
4143
$this->markTestSkipped();
4244
}
4345

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

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

3-
require __DIR__ . '/../vendor/autoload.php';
3+
namespace Clue\Tests\React\Ssdp;
44

5-
class TestCase extends PHPUnit\Framework\TestCase
5+
class TestCase extends \PHPUnit\Framework\TestCase
66
{
77
protected function expectCallableOnce()
88
{

0 commit comments

Comments
 (0)