diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 135099c..5d4e738 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - php: [5.6, 7.0, 7.1, 7.2, 7.3, 7.4] + php: [5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0] steps: - name: Checkout code @@ -24,9 +24,7 @@ jobs: run: composer validate - name: Install dependencies - run: | - composer require phpunit/phpunit "<=8.5.2" --no-update --ignore-platform-reqs - composer install --prefer-dist --no-progress --no-interaction --no-suggest + run: composer install --prefer-dist --no-progress --no-interaction --no-suggest - name: Run test suite run: php vendor/bin/codecept run diff --git a/Robofile.php b/Robofile.php deleted file mode 100644 index 279884f..0000000 --- a/Robofile.php +++ /dev/null @@ -1,21 +0,0 @@ - 

Module reference is taken from the source code. Help us to improve documentation. Edit module reference
'; - $documentationFile = 'documentation.md'; - $this->generateDocumentationForClass($className, $documentationFile, $sourceMessage); - } -} \ No newline at end of file diff --git a/composer.json b/composer.json index d2f4ced..7c6255e 100644 --- a/composer.json +++ b/composer.json @@ -12,14 +12,13 @@ ], "minimum-stability": "RC", "require": { - "php": ">=5.6.0 <8.0", + "php": ">=5.6.0 <9.0", "ext-dom": "*", "codeception/codeception": "^4.0", "codeception/lib-innerbrowser": "^1.0" }, "require-dev": { - "codeception/util-robohelpers": "dev-master", - "codeception/util-universalframework": "dev-master" + "codeception/util-universalframework": "^1.0" }, "autoload":{ "classmap": ["src/"] diff --git a/documentation.md b/documentation.md deleted file mode 100644 index 0f32c2f..0000000 --- a/documentation.md +++ /dev/null @@ -1,230 +0,0 @@ -# SOAP - - -Module for testing SOAP WSDL web services. -Send requests and check if response matches the pattern. - -This module can be used either with frameworks or PHPBrowser. -It tries to guess the framework is is attached to. -If a endpoint is a full url then it uses PHPBrowser. - -### Using Inside Framework - -Please note, that PHP SoapServer::handle method sends additional headers. -This may trigger warning: "Cannot modify header information" -If you use PHP SoapServer with framework, try to block call to this method in testing environment. - -## Status - -* Maintainer: **davert** -* Stability: **stable** -* Contact: codecept@davert.mail.ua - -## Configuration - -* endpoint *required* - soap wsdl endpoint -* SOAPAction - replace SOAPAction HTTP header (Set to '' to SOAP 1.2) - -## Public Properties - -* xmlRequest - last SOAP request (DOMDocument) -* xmlResponse - last SOAP response (DOMDocument) - - -## Actions - -### dontSeeSoapResponseContainsStructure - -Opposite to `seeSoapResponseContainsStructure` - * `param` $xml - - -### dontSeeSoapResponseContainsXPath - -Checks XML response doesn't contain XPath locator - -``` php -dontSeeSoapResponseContainsXPath('//root/user[@id=1]'); -?> -``` - - * `param` $xpath - - -### dontSeeSoapResponseEquals - -Checks XML response equals provided XML. -Comparison is done by canonicalizing both xml`s. - -Parameter can be passed either as XmlBuilder, DOMDocument, DOMNode, XML string, or array (if no attributes). - - * `param` $xml - - -### dontSeeSoapResponseIncludes - -Checks XML response does not include provided XML. -Comparison is done by canonicalizing both xml`s. -Parameter can be passed either as XmlBuilder, DOMDocument, DOMNode, XML string, or array (if no attributes). - - * `param` $xml - - -### grabAttributeFrom - -Finds and returns attribute of element. -Element is matched by either CSS or XPath - - * `Available since` 1.1 - * `param` $cssOrXPath - * `param` $attribute - * `return` string - - -### grabTextContentFrom - -Finds and returns text contents of element. -Element is matched by either CSS or XPath - - * `Available since` 1.1 - * `param` $cssOrXPath - * `return` string - - -### haveSoapHeader - -Prepare SOAP header. -Receives header name and parameters as array. - -Example: - -``` php -haveSoapHeader('AuthHeader', array('username' => 'davert', 'password' => '123345')); -``` - -Will produce header: - -``` - - - - davert - 12345 - - -``` - - * `param` $header - * `param array` $params - - -### seeSoapResponseCodeIs - -Checks response code from server. - - * `param` $code - - -### seeSoapResponseContainsStructure - -Checks XML response contains provided structure. -Response elements will be compared with XML provided. -Only nodeNames are checked to see elements match. - -Example: - -``` php -seeSoapResponseContainsStructure(""); -?> -``` - -Use this method to check XML of valid structure is returned. -This method does not use schema for validation. -This method does not require path from root to match the structure. - - * `param` $xml - - -### seeSoapResponseContainsXPath - -Checks XML response with XPath locator - -``` php -seeSoapResponseContainsXPath('//root/user[@id=1]'); -?> -``` - - * `param` $xpath - - -### seeSoapResponseEquals - -Checks XML response equals provided XML. -Comparison is done by canonicalizing both xml`s. - -Parameters can be passed either as DOMDocument, DOMNode, XML string, or array (if no attributes). - -Example: - -``` php -seeSoapResponseEquals("1"); - -$dom = new \DOMDocument(); -$dom->load($file); -$I->seeSoapRequestIncludes($dom); - -``` - - * `param` $xml - - -### seeSoapResponseIncludes - -Checks XML response includes provided XML. -Comparison is done by canonicalizing both xml`s. -Parameter can be passed either as XmlBuilder, DOMDocument, DOMNode, XML string, or array (if no attributes). - -Example: - -``` php -seeSoapResponseIncludes("1"); -$I->seeSoapRequestIncludes(\Codeception\Utils\Soap::response()->result->val(1)); - -$dom = new \DDOMDocument(); -$dom->load('template.xml'); -$I->seeSoapRequestIncludes($dom); -?> -``` - - * `param` $xml - - -### sendSoapRequest - -Submits request to endpoint. - -Requires of api function name and parameters. -Parameters can be passed either as DOMDocument, DOMNode, XML string, or array (if no attributes). - -You are allowed to execute as much requests as you need inside test. - -Example: - -``` php -$I->sendSoapRequest('UpdateUser', '1notdavert'); -$I->sendSoapRequest('UpdateUser', \Codeception\Utils\Soap::request()->user - ->id->val(1)->parent() - ->name->val('notdavert'); -``` - - * `param` $request - * `param` $body - -

 

Module reference is taken from the source code. Help us to improve documentation. Edit module reference
diff --git a/readme.md b/readme.md index c6174d7..b75e358 100644 --- a/readme.md +++ b/readme.md @@ -10,4 +10,4 @@ composer require --dev "codeception/module-soap" ## Documentation -Look at documentation.md file +[Module documentation](https://codeception.com/docs/modules/SOAP) diff --git a/src/Codeception/Module/SOAP.php b/src/Codeception/Module/SOAP.php index b1f8fb2..579790a 100644 --- a/src/Codeception/Module/SOAP.php +++ b/src/Codeception/Module/SOAP.php @@ -1,9 +1,7 @@ load($this->layout); - $this->assertEqualXMLStructure($this->module->xmlRequest->documentElement, $dom->documentElement); $this->assertXmlStringEqualsXmlString($dom->saveXML(), $this->module->xmlRequest->saveXML()); } @@ -50,7 +49,7 @@ public function testBuildHeaders() $header->appendChild($dom->createElement('username', 'davert')); $header->appendChild($dom->createElement('password', '123456')); $dom->documentElement->getElementsByTagName('Header')->item(0)->appendChild($header); - $this->assertEqualXMLStructure($this->module->xmlRequest->documentElement, $dom->documentElement); + $this->assertXmlStringEqualsXmlString($dom->saveXML(), $this->module->xmlRequest->saveXML()); } public function testBuildRequest() @@ -65,7 +64,7 @@ public function testBuildRequest() $request = $dom->createElement('ns:KillHumans'); $request->appendChild($body); $dom->documentElement->getElementsByTagName('Body')->item(0)->appendChild($request); - $this->assertEqualXMLStructure($this->module->xmlRequest->documentElement, $dom->documentElement); + $this->assertXmlStringEqualsXmlString($dom->saveXML(), $this->module->xmlRequest->saveXML()); } public function testBuildRequestWithDomNode() @@ -80,7 +79,7 @@ public function testBuildRequestWithDomNode() $dom->documentElement->getElementsByTagName('Body')->item(0)->appendChild($request); $this->module->sendSoapRequest('KillHumans', $body); - $this->assertEqualXMLStructure($this->module->xmlRequest->documentElement, $dom->documentElement); + $this->assertXmlStringEqualsXmlString($dom->saveXML(), $this->module->xmlRequest->saveXML()); } public function testSeeXmlIncludes()