dom = self::getTestFileContentAsDom('TestKeyInfoResult.xml'); } public function testConstruct() { $this->_testConstruct('Zend_Service_Technorati_KeyInfoResult', array($this->dom, self::TEST_API_KEY)); } public function testConstructThrowsExceptionWithInvalidDom() { $this->_testConstructThrowsExceptionWithInvalidDom('Zend_Service_Technorati_KeyInfoResult', 'DOMDocument'); } public function testKeyInfoResult() { $object = new Zend_Service_Technorati_KeyInfoResult($this->dom, self::TEST_API_KEY); $this->assertType('string', $object->getApiKey()); $this->assertEquals(self::TEST_API_KEY, $object->getApiKey()); $this->assertType('integer', $object->getApiQueries()); $this->assertEquals(27, $object->getApiQueries()); $this->assertType('integer', $object->getMaxQueries()); $this->assertEquals(1500, $object->getMaxQueries()); } public function testApiKeyIsNullByDefault() { $object = new Zend_Service_Technorati_KeyInfoResult($this->dom); $this->assertEquals(null, $object->getApiKey()); } public function testSetGet() { $object = new Zend_Service_Technorati_KeyInfoResult($this->dom, self::TEST_API_KEY); $set = 'anewapikey'; $get = $object->setApiKey($set)->getApiKey(); $this->assertType('string', $get); $this->assertEquals($set, $get); } }