/** * Test array of models in response defined with wrapper model * @group mock * @depends testClientConstruct */ public function testModelListResponse(Client $client) { // fake a response with multiple valid objects $plugin = new MockPlugin(); $plugin->addResponse(new Response(200, array(), '[{"foo":3},{"foo":4},{"foo":5}]')); $client->addSubscriber($plugin); $response = $client->testwrap(); // test response is a model $this->assertInstanceof('\\Guzzle\\Service\\Resource\\Model', $response); $data = $response->toArray(); //$this->assertCount( 3, $data ); // <- fails $this->assertCount(0, $data); }