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


PHP Response::expects方法代码示例

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


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

示例1: testBind01

 public function testBind01()
 {
     $expectedJSON = file_get_contents(dirname(__DIR__) . '/../../Resources/json/client_aftership_couriers_response_handler_01.json');
     $this->response->expects($this->once())->method('getStatusCode')->will($this->returnValue(200));
     $this->response->expects($this->once())->method('getContent')->will($this->returnValue($expectedJSON));
     $this->responseHandler->bind($this->response, $this->collection);
     $this->assertEquals(26, $this->collection->count());
     $courier0 = $this->collection[0];
     $this->assertEquals('USPS', $courier0->getName());
     $this->assertEquals('United States Postal Service', $courier0->getOtherName());
     $this->assertEquals('+1 800-275-8777', $courier0->getPhone());
     $this->assertEquals(['USA'], $courier0->getServiceCountries());
     $this->assertEquals('usps', $courier0->getSlug());
     $this->assertEquals(['en'], $courier0->getSupportLanguages());
     $this->assertNotNull($courier0->getUpdatedAt());
     $this->assertEquals("https://www.usps.com", $courier0->getUrl());
     $courier13 = $this->collection[13];
     $this->assertEquals('Hong Kong Post', $courier13->getName());
     $this->assertEquals('香港郵政', $courier13->getOtherName());
     $this->assertEquals('+852 2921 2222', $courier13->getPhone());
     $this->assertEquals(['HKG'], $courier13->getServiceCountries());
     $this->assertEquals('hong-kong-post', $courier13->getSlug());
     $this->assertEquals(['en'], $courier13->getSupportLanguages());
     $this->assertNotNull($courier13->getUpdatedAt());
     $this->assertEquals("http://hongkongpost.com", $courier13->getUrl());
 }
开发者ID:antimattr,项目名称:shipment-tracking,代码行数:26,代码来源:CouriersAPIResponseHandlerTest.php


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