Skip to content

Commit dc797f5

Browse files
eXorusDavertMik
authored andcommitted
No more conflict between SOAP and REST (#3532)
* Remove SOAP conflict with API interface * deprecated seeResponseCodeIs use seeSoapResponseCodeIs instead * Update SOAP Test to remove conflicts with api
1 parent 7cdcfbf commit dc797f5

File tree

2 files changed

+15
-24
lines changed

2 files changed

+15
-24
lines changed

src/Codeception/Module/SOAP.php

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?php
22
namespace Codeception\Module;
33

4-
use Codeception\Lib\Interfaces\ConflictsWithModule;
54
use Codeception\Lib\Interfaces\DependsOnModule;
65
use Codeception\Module as CodeceptionModule;
76
use Codeception\TestInterface;
@@ -11,7 +10,6 @@
1110
use Codeception\Lib\InnerBrowser;
1211
use Codeception\Util\Soap as SoapUtils;
1312
use Codeception\Util\XmlStructure;
14-
use Codeception\Lib\Interfaces\API;
1513

1614
/**
1715
* Module for testing SOAP WSDL web services.
@@ -43,21 +41,17 @@
4341
* * xmlRequest - last SOAP request (DOMDocument)
4442
* * xmlResponse - last SOAP response (DOMDocument)
4543
*
46-
* ## Conflicts
47-
*
48-
* Conflicts with REST module
49-
*
5044
*/
51-
class SOAP extends CodeceptionModule implements DependsOnModule, API, ConflictsWithModule
45+
class SOAP extends CodeceptionModule implements DependsOnModule
5246
{
5347
protected $config = [
5448
'schema' => "",
5549
'schema_url' => 'http://schemas.xmlsoap.org/soap/envelope/',
5650
'framework_collect_buffer' => true
5751
];
58-
52+
5953
protected $requiredFields = ['endpoint'];
60-
54+
6155
protected $dependencyMessage = <<<EOF
6256
Example using PhpBrowser as backend for SOAP module.
6357
--
@@ -114,19 +108,14 @@ public function _depends()
114108
return ['Codeception\Lib\InnerBrowser' => $this->dependencyMessage];
115109
}
116110

117-
public function _conflicts()
118-
{
119-
return 'Codeception\Lib\Interfaces\API';
120-
}
121-
122111
public function _inject(InnerBrowser $connectionModule)
123112
{
124113
$this->connectionModule = $connectionModule;
125114
if ($connectionModule instanceof Framework) {
126115
$this->isFunctional = true;
127116
}
128117
}
129-
118+
130119
private function getClient()
131120
{
132121
if (!$this->client) {
@@ -142,15 +131,15 @@ private function getXmlResponse()
142131
}
143132
return $this->xmlResponse;
144133
}
145-
134+
146135
private function getXmlStructure()
147136
{
148137
if (!$this->xmlStructure) {
149138
$this->xmlStructure = new XmlStructure($this->getXmlResponse());
150139
}
151140
return $this->xmlStructure;
152141
}
153-
142+
154143
/**
155144
* Prepare SOAP header.
156145
* Receives header name and parameters as array.
@@ -400,7 +389,7 @@ public function dontSeeSoapResponseContainsXPath($xpath)
400389
*
401390
* @param $code
402391
*/
403-
public function seeResponseCodeIs($code)
392+
public function seeSoapResponseCodeIs($code)
404393
{
405394
$this->assertEquals(
406395
$code,
@@ -409,6 +398,14 @@ public function seeResponseCodeIs($code)
409398
);
410399
}
411400

401+
/**
402+
* @deprecated use seeSoapResponseCodeIs instead
403+
*/
404+
public function seeResponseCodeIs($code)
405+
{
406+
$this->seeSoapResponseCodeIs($code);
407+
}
408+
412409
/**
413410
* Finds and returns text contents of element.
414411
* Element is matched by either CSS or XPath

tests/unit/Codeception/Module/SoapTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ public function setUp()
2929
$this->module->_before(Stub::makeEmpty('\Codeception\Test\Test'));
3030
$this->module->client = Stub::makeEmpty('\Codeception\Lib\Connector\Universal');
3131
}
32-
33-
public function testConflictsWithAPI()
34-
{
35-
$this->assertInstanceOf('Codeception\Lib\Interfaces\ConflictsWithModule', $this->module);
36-
$this->assertEquals('Codeception\Lib\Interfaces\API', $this->module->_conflicts());
37-
}
3832

3933
public function testXmlIsBuilt()
4034
{

0 commit comments

Comments
 (0)