This is a very specific question, and I have search queries for a potential solution, but nothing points me in the right direction. I wrote Zend_Controller_Action_Helper to help me process some forms in my application. Now it works fine in the application, but it throws it to break my tests. If I comment on the lines that add an assistant to the broker, everything works fine, but this view wins the object. The error I get is this
Fatal error: Class 'PHPUnit_Framework_Error_Notice' not found in /Users/chris/NetBeansProjects/myProject/library/ProcessForm.php on line 25
What I don't understand is the reason that it throws this error on line 25, which specifically
public function processForm($aParam)
So, I have to paste the code to show you some applications. I am adding this Helper to the bootstrap of my application, for example ...
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
protected function _initHelpers()
{
require_once 'ProcessForm.php';
Zend_Controller_Action_HelperBroker::addHelper(
new ProcessForm()
);
}
}
My PHPUnit boot file is as follows
require_once 'Zend/Application.php';
require_once 'Zend/Test/PHPUnit/ControllerTestCase.php';
abstract class ControllerTestCase extends Zend_Test_PHPUnit_ControllerTestCase
{
protected $application;
public function setUp()
{
$this->bootstrap = array($this, 'appBootstrap');
parent::setUp();
$this->getFrontController()->setParam('bootstrap', $this->application->getBootstrap());
}
public function appBootstrap()
{
$this->application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
$this->application->bootstrap();
}
}
class ProcessForm extends Zend_Controller_Action_Helper_Abstract
{
public $pluginLoader;
public function __construct()
{
$this->pluginLoader = new Zend_Loader_PluginLoader();
}
public function processForm($aParam)
{
}
public function direct($aParam)
{
return $this->processForm($aParam);
}
}