-
-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trying to get RPC adapters working in integration tests
- Loading branch information
Showing
16 changed files
with
170 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
tests/ProxyManagerTestAsset/RemoteProxy/BazServiceInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* This software consists of voluntary contributions made by many individuals | ||
* and is licensed under the MIT license. | ||
*/ | ||
|
||
namespace ProxyManagerTestAsset\RemoteProxy; | ||
|
||
/** | ||
* Simple interface for a remote API | ||
* | ||
* @author Marco Pivetta <ocramius@gmail.com> | ||
* @license MIT | ||
*/ | ||
interface BazServiceInterface | ||
{ | ||
/** | ||
* @param mixed $param | ||
* | ||
* @return mixed | ||
*/ | ||
public function baz($param); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
/* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* This software consists of voluntary contributions made by many individuals | ||
* and is licensed under the MIT license. | ||
*/ | ||
|
||
namespace ProxyManagerTestAsset\RemoteProxy; | ||
|
||
/** | ||
* Simple interface for a remote API | ||
* | ||
* @author Marco Pivetta <ocramius@gmail.com> | ||
* @license MIT | ||
*/ | ||
class Foo implements FooServiceInterface, BazServiceInterface | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function foo() | ||
{ | ||
return 'bar remote'; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function baz($param) | ||
{ | ||
return $param . ' remote'; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function __get($name) | ||
{ | ||
return $name . ' remote'; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
tests/ProxyManagerTestAsset/RemoteProxy/FooServiceInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* This software consists of voluntary contributions made by many individuals | ||
* and is licensed under the MIT license. | ||
*/ | ||
|
||
namespace ProxyManagerTestAsset\RemoteProxy; | ||
|
||
/** | ||
* Simple interface for a remote API | ||
* | ||
* @author Marco Pivetta <ocramius@gmail.com> | ||
* @license MIT | ||
*/ | ||
interface FooServiceInterface | ||
{ | ||
/** | ||
* @return mixed | ||
*/ | ||
public function foo(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,28 @@ | ||
<?php | ||
|
||
require __DIR__ . '/../../vendor/autoload.php'; | ||
|
||
interface FooServiceInterface | ||
{ | ||
public function foo(); | ||
} | ||
|
||
interface BazServiceInterface | ||
{ | ||
public function baz($param); | ||
} | ||
|
||
class Foo implements FooServiceInterface, BazServiceInterface | ||
{ | ||
public function foo() | ||
{ | ||
return 'bar remote'; | ||
} | ||
|
||
public function baz($param) | ||
{ | ||
return $param . ' remote'; | ||
} | ||
|
||
public function __get($name) | ||
{ | ||
return $name . ' remote'; | ||
} | ||
} | ||
require_once __DIR__ . '/../Bootstrap.php'; | ||
|
||
$server = new Zend\Json\Server\Server(); | ||
$server->setClass('Foo', 'FooServiceInterface'); // my FooServiceInterface implementation | ||
$server->setClass('Foo', 'BazServiceInterface'); // my BazServiceInterface implementation | ||
$server->setClass('ProxyManagerTestAsset\RemoteProxy\Foo', 'ProxyManagerTestAsset\RemoteProxy\FooServiceInterface'); | ||
$server->setClass('ProxyManagerTestAsset\RemoteProxy\Foo', 'ProxyManagerTestAsset\RemoteProxy\BazServiceInterface'); | ||
|
||
$callback = new Zend\Server\Method\Callback(); | ||
$callback->setType('instance') | ||
->setClass('Foo') | ||
->setMethod('__get'); | ||
|
||
$callback | ||
->setType('instance') | ||
->setClass('ProxyManagerTestAsset\RemoteProxy\Foo') | ||
->setMethod('__get'); | ||
|
||
$server->loadFunctions( | ||
array( | ||
new Zend\Server\Method\Definition( | ||
array( | ||
'name' => 'FooServiceInterface.__get', | ||
'name' => 'ProxyManagerTestAsset\RemoteProxy\FooServiceInterface.__get', | ||
'invokeArguments' => array('name'), | ||
'callback' => $callback, | ||
) | ||
) | ||
) | ||
); | ||
|
||
$server->handle(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,9 @@ | ||
<?php | ||
|
||
require __DIR__ . '/../../vendor/autoload.php'; | ||
require_once __DIR__ . '/../Bootstrap.php'; | ||
|
||
interface FooServiceInterface | ||
{ | ||
public function foo(); | ||
} | ||
$server = new Zend\Soap\Server(__DIR__ . '/soap.wsdl'); | ||
|
||
class Foo implements FooServiceInterface | ||
{ | ||
public function foo() | ||
{ | ||
return 'bar remote'; | ||
} | ||
} | ||
$server->setClass('ProxyManagerTestAsset\RemoteProxy\Foo'); | ||
|
||
$server = new Zend\Soap\Server('soap.wsdl'); | ||
$server->setClass('Foo'); // my FooServiceInterface implementation | ||
$server->handle(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.