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
8 changes: 4 additions & 4 deletions tests/data/app/controllers.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ function GET($matches) {
}

function POST() {
setcookie('f', 'b', time() + 60, null, null, false, true);
setcookie('foo', 'bar1', time() + 60, null, 'sub.localhost', false, true);
setcookie('baz', 'bar2', time() + 60, null, 'sub.localhost', false, true);
setcookie('f', 'b', time() + 60, null, null, true, true);
setcookie('foo', 'bar1', time() + 60, null, 'sub.localhost', true, true);
setcookie('baz', 'bar2', time() + 60, null, 'sub.localhost', true, true);
data::set('form', $_POST);
include __DIR__.'/view/cookies.php';
}
Expand Down Expand Up @@ -177,4 +177,4 @@ function GET() {
function POST() {
$this->GET();
}
}
}
4 changes: 2 additions & 2 deletions tests/data/claypit/c3.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function __c3_error($message)
if (!headers_sent()) {
header('X-Codeception-CodeCoverage-Error: ' . str_replace("\n", ' ', $message), true, 500);
}
setcookie('CODECEPTION_CODECOVERAGE_ERROR', $message);
setcookie('CODECEPTION_CODECOVERAGE_ERROR', $message, 0, '', '', true, true);
}
}

Expand Down Expand Up @@ -237,4 +237,4 @@ function () use ($codeCoverage, $current_report) {
}
}

// @codeCoverageIgnoreEnd
// @codeCoverageIgnoreEnd
18 changes: 14 additions & 4 deletions tests/unit/Codeception/Module/SoapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ class SoapTest extends \PHPUnit_Framework_TestCase

protected $layout;

private function createSecureDomDocument() {
if (LIBXML_VERSION < 20900 && function_exists('libxml_disable_entity_loader')) {
libxml_disable_entity_loader(true);
}
$dom = $this->createSecureDomDocument();
$dom->resolveExternals = false;
$dom->substituteEntities = false;
return $dom;
}

public function setUp() {
$this->module = new \Codeception\Module\SOAP();
$this->module->_setConfig(['schema' => 'http://www.w3.org/2001/xml.xsd', 'endpoint' => 'http://codeception.com/api/wsdl']);
Expand All @@ -27,15 +37,15 @@ public function setUp() {
}

public function testXmlIsBuilt() {
$dom = new \DOMDocument();
$dom = $this->createSecureDomDocument();
$dom->load($this->layout);
$this->assertEqualXMLStructure($this->module->xmlRequest->documentElement, $dom->documentElement);
$this->assertXmlStringEqualsXmlString($dom->saveXML(), $this->module->xmlRequest->saveXML());
}

public function testBuildHeaders() {
$this->module->haveSoapHeader('AuthHeader', ['username' => 'davert', 'password' => '123456']);
$dom = new \DOMDocument();
$dom = $this->createSecureDomDocument();
$dom->load($this->layout);
$header = $dom->createElement('AuthHeader');
$header->appendChild($dom->createElement('username','davert'));
Expand All @@ -48,7 +58,7 @@ public function testBuildRequest()
{
$this->module->sendSoapRequest('KillHumans', "<item><id>1</id><subitem>2</subitem></item>");
$this->assertNotNull($this->module->xmlRequest);
$dom = new \DOMDocument();
$dom = $this->createSecureDomDocument();
$dom->load($this->layout);
$body = $dom->createElement('item');
$body->appendChild($dom->createElement('id',1));
Expand All @@ -60,7 +70,7 @@ public function testBuildRequest()
}

public function testBuildRequestWithDomNode() {
$dom = new \DOMDocument();
$dom = $this->createSecureDomDocument();
$dom->load($this->layout);
$body = $dom->createElement('item');
$body->appendChild($dom->createElement('id',1));
Expand Down