public static function setUpBeforeClass() { self::$client = new Client(); $getListsStream = Stream::factory(JsonLoader::getListsJson()); $getListStream = Stream::factory(JsonLoader::getListJson()); $getContactsStream = Stream::factory(JsonLoader::getContactsJson()); $mock = new Mock([new Response(200, array(), $getListsStream), new Response(200, array(), $getListStream), new Response(201, array(), $getListStream), new Response(200, array(), $getListStream), new Response(200, array(), $getContactsStream)]); self::$client->getEmitter()->attach($mock); }
public function testGetListsModifiedSince() { $curlResponse = CurlResponse::create(JsonLoader::getListsJson(), array('http_code' => 200)); $this->restClient->expects($this->once())->method('get')->with()->will($this->returnValue($curlResponse)); $response = $this->listService->getLists('access_token', array('modified_since' => '2013-01-12T20:04:59.436Z')); $this->assertInstanceOf("Ctct\\Components\\Contacts\\ContactList", $response[0]); $this->assertEquals(1, $response[0]->id); $this->assertEquals("General Interest", $response[0]->name); $this->assertEquals("ACTIVE", $response[0]->status); $this->assertEquals(17, $response[0]->contact_count); $this->assertEquals(3, $response[1]->id); $this->assertEquals("mod_Test List 1", $response[1]->name); $this->assertEquals("HIDDEN", $response[1]->status); $this->assertEquals(18, $response[1]->contact_count); }