assertEquals(get_class(API::getApiService()), 'CApiService'); $this->assertEquals(get_class(API::getApiService('item')), 'CItem'); } /** * Test that the API::getApi() method returns a correct result without a wrapper. */ public function testGetApiNoWrapper() { $this->assertEquals(get_class(API::getApi('item')), 'CItem'); } /** * Test that the API::getApi() method returns correct results with a wrapper. */ public function testGetGetApiWrapper() { $client = new CLocalApiClient(); API::setWrapper(new CApiWrapper($client)); $item = API::getApi('item'); $this->assertEquals(get_class($item), 'CApiWrapper'); $this->assertEquals($item->api, 'item'); API::setWrapper(); } }