当前位置: 首页>>代码示例>>PHP>>正文


PHP AdWordsUser::GetClientLibraryNameAndVersion方法代码示例

本文整理汇总了PHP中AdWordsUser::GetClientLibraryNameAndVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP AdWordsUser::GetClientLibraryNameAndVersion方法的具体用法?PHP AdWordsUser::GetClientLibraryNameAndVersion怎么用?PHP AdWordsUser::GetClientLibraryNameAndVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AdWordsUser的用法示例。


在下文中一共展示了AdWordsUser::GetClientLibraryNameAndVersion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testIntegrationCheckUserAgent

 /**
  * Tests that the user agent header is properly set for this client library.
  */
 public function testIntegrationCheckUserAgent()
 {
     // Get the response xml
     $xmlResponse = $this->assetHelper->getAsset(sprintf(self::RESPONSE_NAME, self::SERVICE));
     // Create a regular AdWordsUser
     $user = new AdWordsUser($this->assetHelper->getAssetPath('auth.ini'));
     $campaignService = $user->getService(self::SERVICE);
     // Build a mocked SoapClient
     $headerPortion = implode('/', $user->GetClientLibraryNameAndVersion());
     // Setup the test.
     $soapClientMock = $this->getMockBuilder('SoapClient')->setMethods(array('__doRequest'))->disableOriginalConstructor()->getMock();
     $soapClientMock->expects($this->any())->method('__doRequest')->with($this->stringContains($headerPortion, false))->will($this->returnValue($xmlResponse));
     // Set the transport layer on the soap client to be the mocked soap client.
     $campaignService->__SetTransportLayer($soapClientMock);
     // Create selector.
     $selector = new Selector();
     // Specify the fields to retrieve.
     $selector->fields = array('Login', 'CustomerId', 'Name');
     // Make the get request.
     $graph = $campaignService->get($selector);
     $this->assertEquals($graph->entries[0]->id, self::CAMPAIGN_ID);
 }
开发者ID:phobik,项目名称:google-api-adwords-php,代码行数:25,代码来源:AdWordsIntegrationTest.php


注:本文中的AdWordsUser::GetClientLibraryNameAndVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。