/** * Ensures that the query API throws an exception when a category is not first provided * * @return void */ public function testQueryExceptionCategoryMissing() { $this->setExpectedException( 'Zend\Service\Amazon\Exception\RuntimeException', 'You must set a category before setting the search parameters' ); $this->_query->Keywords('php'); }
/** * Ensures that the query API throws an exception when a category is not first provided * * @return void */ public function testQueryExceptionCategoryMissing() { try { $this->_query->Keywords('php'); $this->fail('Expected Zend_Service_Exception not thrown'); } catch (Zend_Service_Exception $e) { $this->assertContains('set a category', $e->getMessage()); } }