Skip to content

Commit 140f9a4

Browse files
authored
Merge pull request #42 from SimonFrings/tests
Run tests on PHP 7.4 and simplify test matrix, clean up test suite and add .gitattributes to exclude dev files from exports
2 parents 54d1fb9 + 62b8e6b commit 140f9a4

File tree

7 files changed

+36
-24
lines changed

7 files changed

+36
-24
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 & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
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-
- hhvm # ignore errors, see below
13-
143
# lock distro so new future defaults will not break the build
154
dist: trusty
165

176
matrix:
187
include:
198
- php: 5.3
209
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
2119
allow_failures:
22-
- php: hhvm
20+
- php: hhvm-3.18
2321

2422
sudo: false
2523

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"autoload": {
1414
"psr-4": { "Clue\\React\\Soap\\": "src/" }
1515
},
16+
"autoload-dev": {
17+
"psr-4": { "Clue\\Tests\\React\\Soap\\": "tests/" }
18+
},
1619
"require": {
1720
"php": ">=5.3",
1821
"clue/buzz-react": "^2.5",
@@ -22,6 +25,6 @@
2225
},
2326
"require-dev": {
2427
"clue/block-react": "^1.0",
25-
"phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35"
28+
"phpunit/phpunit": "^7.0 || ^6.4 || ^5.7 || ^4.8.35"
2629
}
2730
}

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="vendor/autoload.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>
116
<directory>./tests/</directory>

tests/ClientTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
<?php
22

3+
namespace Clue\Tests\React\Soap;
4+
35
use Clue\React\Soap\Client;
46
use PHPUnit\Framework\TestCase;
57
use React\Promise\Promise;
68
use Psr\Http\Message\RequestInterface;
79

810
class ClientTest extends TestCase
911
{
12+
13+
/**
14+
* @expectedException SoapFault
15+
*/
1016
public function testConstructorThrowsWhenUrlIsInvalid()
1117
{
1218
if (extension_loaded('xdebug')) {

tests/FunctionalTest.php

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

3+
namespace Clue\Tests\React\Soap;
4+
35
use Clue\React\Block;
46
use Clue\React\Buzz\Browser;
57
use Clue\React\Soap\Client;
@@ -16,7 +18,7 @@ class BankResponse
1618
class FunctionalTest extends TestCase
1719
{
1820
/**
19-
* @var React\EventLoop\LoopInterface
21+
* @var \React\EventLoop\LoopInterface
2022
*/
2123
private $loop;
2224

@@ -34,7 +36,7 @@ public static function setUpBeforeClass()
3436

3537
public function setUp()
3638
{
37-
$this->loop = React\EventLoop\Factory::create();
39+
$this->loop = \React\EventLoop\Factory::create();
3840
$this->client = new Client(new Browser($this->loop), self::$wsdl);
3941
}
4042

@@ -58,7 +60,7 @@ public function testBlzServiceWithClassmapReturnsExpectedType()
5860
{
5961
$this->client = new Client(new Browser($this->loop), self::$wsdl, array(
6062
'classmap' => array(
61-
'getBankResponseType' => 'BankResponse'
63+
'getBankResponseType' => 'Clue\Tests\React\Soap\BankResponse'
6264
)
6365
));
6466

@@ -71,7 +73,7 @@ public function testBlzServiceWithClassmapReturnsExpectedType()
7173

7274
$result = Block\await($promise, $this->loop);
7375

74-
$this->assertInstanceOf('BankResponse', $result);
76+
$this->assertInstanceOf('Clue\Tests\React\Soap\BankResponse', $result);
7577
$this->assertTrue(isset($result->details));
7678
$this->assertTrue(isset($result->details->bic));
7779
}
@@ -107,7 +109,7 @@ public function testBlzServiceNonWsdlModeReturnedWithoutOuterResultStructure()
107109

108110
// try encoding the "blz" parameter with the correct namespace (see uri)
109111
// $promise = $api->getBank(new SoapParam('12070000', 'ns1:blz'));
110-
$promise = $api->getBank(new SoapVar('12070000', XSD_STRING, null, null, 'blz', 'http://thomas-bayer.com/blz/'));
112+
$promise = $api->getBank(new \SoapVar('12070000', XSD_STRING, null, null, 'blz', 'http://thomas-bayer.com/blz/'));
111113

112114
$result = Block\await($promise, $this->loop);
113115

tests/ProxyTest.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\Soap;
4+
35
use PHPUnit\Framework\TestCase;
46
use Clue\React\Soap\Proxy;
57

0 commit comments

Comments
 (0)