You are here

protected function PHPUnit_Framework_TestCase::getMockFromWsdl in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/Framework/TestCase.php \PHPUnit_Framework_TestCase::getMockFromWsdl()

Returns a mock object based on the given WSDL file.

@since Method available since Release 3.4.0

Parameters

string $wsdlFile:

string $originalClassName:

string $mockClassName:

array $methods:

bool $callOriginalConstructor:

array $options An array of options passed to SOAPClient::_construct:

Return value

PHPUnit_Framework_MockObject_MockObject

3 calls to PHPUnit_Framework_TestCase::getMockFromWsdl()
Framework_MockObjectTest::testCreateMockFromWsdl in vendor/phpunit/phpunit-mock-objects/tests/MockObjectTest.php
@requires extension soap
Framework_MockObjectTest::testCreateNamespacedMockFromWsdl in vendor/phpunit/phpunit-mock-objects/tests/MockObjectTest.php
@requires extension soap
Framework_MockObjectTest::testCreateTwoMocksOfOneWsdlFile in vendor/phpunit/phpunit-mock-objects/tests/MockObjectTest.php
@requires extension soap

File

vendor/phpunit/phpunit/src/Framework/TestCase.php, line 1397

Class

PHPUnit_Framework_TestCase
A TestCase defines the fixture to run multiple tests.

Code

protected function getMockFromWsdl($wsdlFile, $originalClassName = '', $mockClassName = '', array $methods = array(), $callOriginalConstructor = true, array $options = array()) {
  if ($originalClassName === '') {
    $originalClassName = str_replace('.wsdl', '', basename($wsdlFile));
  }
  if (!class_exists($originalClassName)) {
    eval($this
      ->getMockObjectGenerator()
      ->generateClassFromWsdl($wsdlFile, $originalClassName, $methods, $options));
  }
  return $this
    ->getMock($originalClassName, $methods, array(
    '',
    $options,
  ), $mockClassName, $callOriginalConstructor, false, false);
}