/** * */ public function testGetSoapClientStreamContextOptions() { $options = GeneratorOptionsTest::optionsInstance(); $options->setOrigin(self::onlineWsdlBingPath())->setDestination(self::getTestDirectory())->setSoapOptions(array(AbstractSoapClientBase::WSDL_STREAM_CONTEXT => stream_context_create(array('https' => array('X-Header' => 'X-Value'), 'ssl' => array('ca_file' => basename(__FILE__), 'ca_path' => __DIR__, 'verify_peer' => true))))); $instance = new Generator($options); // HTTP headers are added to the context options with certain PHP version on certain platform // this test is focused on the defined options and not those which are added after // so we remove those we are not interested in! $contextOptions = $instance->getSoapClient()->getSoapClientStreamContextOptions(); foreach (array_keys($contextOptions) as $index) { if ($index !== 'https' && $index !== 'ssl') { unset($contextOptions[$index]); } } $this->assertSame(array('https' => array('X-Header' => 'X-Value'), 'ssl' => array('ca_file' => basename(__FILE__), 'ca_path' => __DIR__, 'verify_peer' => true)), $contextOptions); }