I am having problems so that my filters / validators work correctly in my form, so I want to create a Unit test to verify that the data that I submit to my form is filtered and validated correctly.
I started by auto-generating the PHPUnit test in Zend Studio, which gives me the following:
<?php
require_once 'PHPUnit/Framework/TestCase.php';
class Form_EventTest extends PHPUnit_Framework_TestCase
{
private $Form_Event;
protected function setUp ()
{
parent::setUp();
$this->Form_Event = new Form_Event();
}
protected function tearDown ()
{
$this->Form_Event = null;
parent::tearDown();
}
public function __construct ()
{
}
public function testInit ()
{
$this->markTestIncomplete(
"init test not implemented");
$this->Form_Event->init();
}
public function testGetFormattedMessages ()
{
$this->markTestIncomplete(
"getFormattedMessages test not implemented");
$this->Form_Event->getFormattedMessages();
}
}
so I open the terminal, go to the directory and try to run the test:
$ cd my_app/tests/unit/application/forms
$ phpunit EventTest.php
Fatal error: Class 'Form_Event' not found in .../tests/unit/application/forms/EventTest.php on line 19
, require_once , Form . , . . , , .. Zend_Form. ? , , , . ?