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()); }