Skip to content

Run tests on PHP 7.4 and simplify test matrix, clean up test suite and add .gitattributes to exclude dev files from exports #42

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

Merged
merged 4 commits into from
May 20, 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 new 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
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"autoload": {
"psr-4": { "Clue\\React\\Soap\\": "src/" }
},
"autoload-dev": {
"psr-4": { "Clue\\Tests\\React\\Soap\\": "tests/" }
},
"require": {
"php": ">=5.3",
"clue/buzz-react": "^2.5",
Expand All @@ -22,6 +25,6 @@
},
"require-dev": {
"clue/block-react": "^1.0",
"phpunit/phpunit": "^6.4 || ^5.7 || ^4.8.35"
"phpunit/phpunit": "^7.0 || ^6.4 || ^5.7 || ^4.8.35"
}
}
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="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
>
<phpunit bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite>
<directory>./tests/</directory>
Expand Down
6 changes: 6 additions & 0 deletions tests/ClientTest.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<?php

namespace Clue\Tests\React\Soap;

use Clue\React\Soap\Client;
use PHPUnit\Framework\TestCase;
use React\Promise\Promise;
use Psr\Http\Message\RequestInterface;

class ClientTest extends TestCase
{

/**
* @expectedException SoapFault
*/
public function testConstructorThrowsWhenUrlIsInvalid()
{
if (extension_loaded('xdebug')) {
Expand Down
12 changes: 7 additions & 5 deletions tests/FunctionalTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\React\Soap;

use Clue\React\Block;
use Clue\React\Buzz\Browser;
use Clue\React\Soap\Client;
Expand All @@ -16,7 +18,7 @@ class BankResponse
class FunctionalTest extends TestCase
{
/**
* @var React\EventLoop\LoopInterface
* @var \React\EventLoop\LoopInterface
*/
private $loop;

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

public function setUp()
{
$this->loop = React\EventLoop\Factory::create();
$this->loop = \React\EventLoop\Factory::create();
$this->client = new Client(new Browser($this->loop), self::$wsdl);
}

Expand All @@ -58,7 +60,7 @@ public function testBlzServiceWithClassmapReturnsExpectedType()
{
$this->client = new Client(new Browser($this->loop), self::$wsdl, array(
'classmap' => array(
'getBankResponseType' => 'BankResponse'
'getBankResponseType' => 'Clue\Tests\React\Soap\BankResponse'
)
));

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

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

$this->assertInstanceOf('BankResponse', $result);
$this->assertInstanceOf('Clue\Tests\React\Soap\BankResponse', $result);
$this->assertTrue(isset($result->details));
$this->assertTrue(isset($result->details->bic));
}
Expand Down Expand Up @@ -107,7 +109,7 @@ public function testBlzServiceNonWsdlModeReturnedWithoutOuterResultStructure()

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

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

Expand Down
2 changes: 2 additions & 0 deletions tests/ProxyTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\React\Soap;

use PHPUnit\Framework\TestCase;
use Clue\React\Soap\Proxy;

Expand Down