本文整理汇总了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());
}