/** * Tests that calling a helper whose file exists but class is not found within * throws the expected exception */ public function testLoadHelperNonexistantClass() { $view = new Zend_View(); $view->setHelperPath(array(dirname(__FILE__) . '/View/_stubs/HelperDir1')); try { // attempt to load the helper StubEmpty, whose file exists but // does not contain the expected class within $view->stubEmpty(); // @todo fail if no exception? } catch (Zend_Exception $e) { $this->assertContains("not found", $e->getMessage()); } }
/** * Tests that calling a helper whose file exists but class is not found within * throws the expected exception */ public function testLoadHelperNonexistantClass() { $view = new Zend_View(); $view->setHelperPath(array(dirname(__FILE__) . '/View/_stubs/HelperDir1')); try { // attempt to load the helper StubEmpty, whose file exists but // does not contain the expected class within $view->stubEmpty(); } catch (Zend_View_Exception $e) { $this->assertRegexp('/loaded but class [\'_A-z]+ not found/i', $e->getMessage()); } }