Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge pull request #3518 from ayastreb/zf3082
Browse files Browse the repository at this point in the history
[#3082] added handle() method to AutoDiscover to publish result.
  • Loading branch information
Maks3w committed Jan 23, 2013
2 parents 5cadedb + a006e59 commit af65980
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions library/Zend/Soap/AutoDiscover.php
Expand Up @@ -544,4 +544,13 @@ public function toXml()
{
return $this->generate()->toXml();
}

/**
* Handle WSDL document.
*/
public function handle()
{
header('Content-Type: text/xml');
echo $this->toXml();
}
}
17 changes: 17 additions & 0 deletions tests/ZendTest/Soap/AutoDiscoverTest.php
Expand Up @@ -730,6 +730,23 @@ public function testRecursiveWsdlDependencies()
$this->assertWsdlPathExists($wsdl, $path);
}

/**
* @runInSeparateProcess
*/
public function testHandle()
{
$scriptUri = 'http://localhost/my_script.php';

$server = $this->createAutodiscoverService();
$server->setClass('\ZendTest\Soap\TestAsset\Test');

ob_start();
$server->handle();
$actualWsdl = ob_get_clean();
$this->assertNotEmpty($actualWsdl, "WSDL content was not outputted.");
$this->assertContains($scriptUri, $actualWsdl, "Script URL was not found in WSDL content.");
}

public function assertWsdlPathExists($xml, $path)
{
$doc = new \DOMDocument('UTF-8');
Expand Down

0 comments on commit af65980

Please sign in to comment.