Skip to content
Open
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
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
},
"require": {
"php": ">=7.1",
"react/http": "^1.5",
"react/promise": "^2.1 || ^1.2",
"react/http": "^1.11",
"react/promise": "^3.2 || ^2.1 || ^1.2",
"laminas/laminas-diactoros": "^3.5 || ^2.4",
"ext-soap": "*"
},
"require-dev": {
"clue/block-react": "^1.0",
"phpunit/phpunit": "^9.3 || ^7.5"
"react/async": "^4.3 || ^3.2",
"phpunit/phpunit": "^9.6 || ^7.5"
}
}
11 changes: 7 additions & 4 deletions src/Protocol/ClientEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
namespace Clue\React\Soap\Protocol;

use Psr\Http\Message\RequestInterface;
use RingCentral\Psr7\Request;
use Laminas\Diactoros\Request;
use Laminas\Diactoros\StreamFactory;

/**
* @internal
Expand Down Expand Up @@ -56,11 +57,13 @@ public function __doRequest($request, $location, $action, $version, $one_way = 0
);
}

$body = (new StreamFactory())->createStream((string)$request);

$this->request = new Request(
'POST',
(string)$location,
$headers,
(string)$request
'POST',
$body,
$headers
);

// do not actually block here, just pretend we're done...
Expand Down
24 changes: 12 additions & 12 deletions tests/FunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Clue\Tests\React\Soap;

use Clue\React\Block;
use React\Async;
use React\Http\Browser;
use Clue\React\Soap\Client;
use Clue\React\Soap\Proxy;
use PHPUnit\Framework\TestCase;
use React\EventLoop\Loop;
use React\Http\Browser;


class BankResponse
{
Expand Down Expand Up @@ -55,7 +55,7 @@ public function testBlzService()

$promise = $api->getBank(array('blz' => '12070000'));

$result = Block\await($promise, Loop::get());
$result = Async\await($promise);

$this->assertIsObject($result);
$this->assertTrue(isset($result->details));
Expand All @@ -77,7 +77,7 @@ public function testBlzServiceWithClassmapReturnsExpectedType()

$promise = $api->getBank(array('blz' => '12070000'));

$result = Block\await($promise, Loop::get());
$result = Async\await($promise);

$this->assertInstanceOf('Clue\Tests\React\Soap\BankResponse', $result);
$this->assertTrue(isset($result->details));
Expand All @@ -97,7 +97,7 @@ public function testBlzServiceWithSoapV12()

$promise = $api->getBank(array('blz' => '12070000'));

$result = Block\await($promise, Loop::get());
$result = Async\await($promise);

$this->assertIsObject($result);
$this->assertTrue(isset($result->details));
Expand All @@ -117,7 +117,7 @@ public function testBlzServiceNonWsdlModeReturnedWithoutOuterResultStructure()
// $promise = $api->getBank(new SoapParam('12070000', 'ns1:blz'));
$promise = $api->getBank(new \SoapVar('12070000', XSD_STRING, null, null, 'blz', 'http://thomas-bayer.com/blz/'));

$result = Block\await($promise, Loop::get());
$result = Async\await($promise);

$this->assertIsObject($result);
$this->assertFalse(isset($result->details));
Expand Down Expand Up @@ -158,7 +158,7 @@ public function testBlzServiceWithInvalidMethodRejectsWithSoapFault()

$this->expectException(\SoapFault::class);
$this->expectExceptionMessage('Function ("doesNotExist") is not a valid method for this service');
Block\await($promise, Loop::get());
Async\await($promise);
}

public function testCancelMethodRejectsWithRuntimeException()
Expand All @@ -170,7 +170,7 @@ public function testCancelMethodRejectsWithRuntimeException()

$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('cancelled');
Block\await($promise, Loop::get());
Async\await($promise);
}

public function testTimeoutRejectsWithRuntimeException()
Expand All @@ -185,7 +185,7 @@ public function testTimeoutRejectsWithRuntimeException()

$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('timed out');
Block\await($promise, Loop::get());
Async\await($promise);
}

public function testGetLocationForFunctionName()
Expand Down Expand Up @@ -236,7 +236,7 @@ public function testWithLocationInvalidRejectsWithRuntimeException()
$promise = $api->getBank(array('blz' => '12070000'));

$this->expectException(\RuntimeException::class);
Block\await($promise, Loop::get());
Async\await($promise);
}

public function testWithLocationRestoredToOriginalResolves()
Expand All @@ -248,7 +248,7 @@ public function testWithLocationRestoredToOriginalResolves()

$promise = $api->getBank(array('blz' => '12070000'));

$result = Block\await($promise, Loop::get());
$result = Async\await($promise);
$this->assertIsObject($result);
}
}
Loading