Skip to content

Commit 1087c9b

Browse files
committed
Updated REST and SOAP modules to conflict with each other. Closes #3104 (#3108)
* updated REST and SOAP modules to conflict with each other. Closes #3104 * nitpick suggested fixes
1 parent c87ebfd commit 1087c9b

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/Codeception/Module/SOAP.php

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

4+
use Codeception\Lib\Interfaces\ConflictsWithModule;
45
use Codeception\Lib\Interfaces\DependsOnModule;
56
use Codeception\Module as CodeceptionModule;
67
use Codeception\TestInterface;
@@ -10,6 +11,7 @@
1011
use Codeception\Lib\InnerBrowser;
1112
use Codeception\Util\Soap as SoapUtils;
1213
use Codeception\Util\XmlStructure;
14+
use Codeception\Lib\Interfaces\API;
1315

1416
/**
1517
* Module for testing SOAP WSDL web services.
@@ -40,8 +42,12 @@
4042
* * xmlRequest - last SOAP request (DOMDocument)
4143
* * xmlResponse - last SOAP response (DOMDocument)
4244
*
45+
* ## Conflicts
46+
*
47+
* Conflicts with REST module
48+
*
4349
*/
44-
class SOAP extends CodeceptionModule implements DependsOnModule
50+
class SOAP extends CodeceptionModule implements DependsOnModule, API, ConflictsWithModule
4551
{
4652
protected $config = [
4753
'schema' => "",
@@ -100,6 +106,11 @@ public function _depends()
100106
return ['Codeception\Lib\InnerBrowser' => $this->dependencyMessage];
101107
}
102108

109+
public function _conflicts()
110+
{
111+
return 'Codeception\Lib\Interfaces\API';
112+
}
113+
103114
public function _inject(InnerBrowser $connectionModule)
104115
{
105116
$this->connectionModule = $connectionModule;

tests/unit/Codeception/Module/SoapTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ public function setUp() {
2525
$this->module->_before(Stub::makeEmpty('\Codeception\Test\Test'));
2626
$this->module->client = Stub::makeEmpty('\Codeception\Lib\Connector\Universal');
2727
}
28+
29+
public function testConflictsWithAPI()
30+
{
31+
$this->assertInstanceOf('Codeception\Lib\Interfaces\ConflictsWithModule', $this->module);
32+
$this->assertEquals('Codeception\Lib\Interfaces\API', $this->module->_conflicts());
33+
}
2834

2935
public function testXmlIsBuilt() {
3036
$dom = new \DOMDocument();

0 commit comments

Comments
 (0)