|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace WsdlToPhp\PackageBase\Tests; |
| 4 | + |
| 5 | + |
| 6 | +use WsdlToPhp\PackageBase\Tests\SoapClient; |
| 7 | + |
| 8 | +class SoapClientTest extends TestCase |
| 9 | +{ |
| 10 | + /** |
| 11 | + * |
| 12 | + */ |
| 13 | + public function testSoapClientName() |
| 14 | + { |
| 15 | + $soapClient = new SoapClient(); |
| 16 | + |
| 17 | + $this->assertSame('\\WsdlToPhp\\PackageBase\\Tests\\Client', $soapClient->getSoapClientClassName()); |
| 18 | + } |
| 19 | + /** |
| 20 | + * |
| 21 | + */ |
| 22 | + public function testSoapClientNameDefault() |
| 23 | + { |
| 24 | + $soapClient = new SoapClient(); |
| 25 | + |
| 26 | + $this->assertSame('\SoapClient', $soapClient->getSoapClientClassName('\\WsdlToPhp\\PackageBase\\Tests\\Clien')); |
| 27 | + } |
| 28 | + /** |
| 29 | + * |
| 30 | + */ |
| 31 | + public function testSoapClient() |
| 32 | + { |
| 33 | + $soapClient = new SoapClient(array( |
| 34 | + SoapClient::WSDL_URL => __DIR__ . '/resources/bingsearch.wsdl', |
| 35 | + SoapClient::WSDL_CLASSMAP => self::classMap(), |
| 36 | + )); |
| 37 | + |
| 38 | + $this->assertInstanceOf('\\WsdlToPhp\\PackageBase\\Tests\\Client', SoapClient::getSoapClient()); |
| 39 | + } |
| 40 | + /** |
| 41 | + * @return string[] |
| 42 | + */ |
| 43 | + public static function classMap() |
| 44 | + { |
| 45 | + return array ( |
| 46 | + 'AdultOption' => 'ApiEnumAdultOption', |
| 47 | + 'ArrayOfDeepLink' => 'ApiStructArrayOfDeepLink', |
| 48 | + 'ArrayOfError' => 'ApiStructArrayOfError', |
| 49 | + 'ArrayOfImageResult' => 'ApiStructArrayOfImageResult', |
| 50 | + 'ArrayOfInstantAnswerResult' => 'ApiStructArrayOfInstantAnswerResult', |
| 51 | + 'ArrayOfMobileWebResult' => 'ApiStructArrayOfMobileWebResult', |
| 52 | + 'ArrayOfMobileWebSearchOption' => 'ApiStructArrayOfMobileWebSearchOption', |
| 53 | + 'ArrayOfNewsArticle' => 'ApiStructArrayOfNewsArticle', |
| 54 | + 'ArrayOfNewsCollection' => 'ApiStructArrayOfNewsCollection', |
| 55 | + 'ArrayOfNewsRelatedSearch' => 'ApiStructArrayOfNewsRelatedSearch', |
| 56 | + 'ArrayOfNewsResult' => 'ApiStructArrayOfNewsResult', |
| 57 | + 'ArrayOfRelatedSearchResult' => 'ApiStructArrayOfRelatedSearchResult', |
| 58 | + 'ArrayOfSearchOption' => 'ApiStructArrayOfSearchOption', |
| 59 | + 'ArrayOfSourceType' => 'ApiStructArrayOfSourceType', |
| 60 | + 'ArrayOfSpellResult' => 'ApiStructArrayOfSpellResult', |
| 61 | + 'ArrayOfString' => 'ApiStructArrayOfString', |
| 62 | + 'ArrayOfVideoResult' => 'ApiStructArrayOfVideoResult', |
| 63 | + 'ArrayOfWebResult' => 'ApiStructArrayOfWebResult', |
| 64 | + 'ArrayOfWebSearchOption' => 'ApiStructArrayOfWebSearchOption', |
| 65 | + 'ArrayOfWebSearchTag' => 'ApiStructArrayOfWebSearchTag', |
| 66 | + 'DeepLink' => 'ApiStructDeepLink', |
| 67 | + 'Error' => 'ApiStructError', |
| 68 | + 'ImageRequest' => 'ApiStructImageRequest', |
| 69 | + 'ImageResponse' => 'ApiStructImageResponse', |
| 70 | + 'ImageResult' => 'ApiStructImageResult', |
| 71 | + 'InstantAnswerResponse' => 'ApiStructInstantAnswerResponse', |
| 72 | + 'InstantAnswerResult' => 'ApiStructInstantAnswerResult', |
| 73 | + 'MobileWebRequest' => 'ApiStructMobileWebRequest', |
| 74 | + 'MobileWebResponse' => 'ApiStructMobileWebResponse', |
| 75 | + 'MobileWebResult' => 'ApiStructMobileWebResult', |
| 76 | + 'MobileWebSearchOption' => 'ApiEnumMobileWebSearchOption', |
| 77 | + 'NewsArticle' => 'ApiStructNewsArticle', |
| 78 | + 'NewsCollection' => 'ApiStructNewsCollection', |
| 79 | + 'NewsRelatedSearch' => 'ApiStructNewsRelatedSearch', |
| 80 | + 'NewsRequest' => 'ApiStructNewsRequest', |
| 81 | + 'NewsResponse' => 'ApiStructNewsResponse', |
| 82 | + 'NewsResult' => 'ApiStructNewsResult', |
| 83 | + 'NewsSortOption' => 'ApiEnumNewsSortOption', |
| 84 | + 'PhonebookRequest' => 'ApiStructPhonebookRequest', |
| 85 | + 'PhonebookSortOption' => 'ApiEnumPhonebookSortOption', |
| 86 | + 'Query' => 'ApiStructQuery', |
| 87 | + 'RelatedSearchResponse' => 'ApiStructRelatedSearchResponse', |
| 88 | + 'RelatedSearchResult' => 'ApiStructRelatedSearchResult', |
| 89 | + 'SearchOption' => 'ApiEnumSearchOption', |
| 90 | + 'SearchRequest' => 'ApiStructSearchRequest', |
| 91 | + 'SearchResponse' => 'ApiStructSearchResponse', |
| 92 | + 'SourceType' => 'ApiEnumSourceType', |
| 93 | + 'SpellResponse' => 'ApiStructSpellResponse', |
| 94 | + 'SpellResult' => 'ApiStructSpellResult', |
| 95 | + 'Thumbnail' => 'ApiStructThumbnail', |
| 96 | + 'TranslationRequest' => 'ApiStructTranslationRequest', |
| 97 | + 'VideoRequest' => 'ApiStructVideoRequest', |
| 98 | + 'VideoResponse' => 'ApiStructVideoResponse', |
| 99 | + 'VideoResult' => 'ApiStructVideoResult', |
| 100 | + 'VideoSortOption' => 'ApiEnumVideoSortOption', |
| 101 | + 'WebRequest' => 'ApiStructWebRequest', |
| 102 | + 'WebResponse' => 'ApiStructWebResponse', |
| 103 | + 'WebResult' => 'ApiStructWebResult', |
| 104 | + 'WebSearchOption' => 'ApiEnumWebSearchOption', |
| 105 | + 'WebSearchTag' => 'ApiStructWebSearchTag', |
| 106 | + ); |
| 107 | + } |
| 108 | +} |
0 commit comments