I am trying to figure out the "right" way to build my unit tests.
I am using Zend_AMF configured the way Wade Arnold recommended on his blog.
In a nutshell, I am not using Controllers at all. I basically do "bootstrapping" tasks in my index.php. Below is a snippet for clarity:
Many of the examples of using Zend_Test I have seen use Zend_Test_PHPUnit_ControllerTestCaseCode:// Define path to application directory defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); // Define application environment defined('APPLICATION_ENV') || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development')); date_default_timezone_set('America/Chicago'); set_include_path( get_include_path() . PATH_SEPARATOR . APPLICATION_PATH . '/../library/' . PATH_SEPARATOR . APPLICATION_PATH . '/models/' . PATH_SEPARATOR . APPLICATION_PATH . '/services/' ); // Autoloading so we don't explicitly need to import classes require_once 'Zend/Loader/Autoloader.php'; $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->setFallbackAutoloader(true); // Set up the AMF logging $logger = new Zend_Log(); $writer = new Zend_Log_Writer_Stream(APPLICATION_PATH . '/data/logs/services.log'); $logger->addWriter($writer); Zend_Registry::set('services', $logger); //Instantiate the AMF Server //Lazy load directory of services to provide via AMF $server = new Zend_Amf_Server(); $server->addDirectory( APPLICATION_PATH . '/services/' ); // Allow for better error responses // Change to true for production, duh! $server->setProduction ( false ); //Return what the amf server delivers echo($server->handle());
If I have no controllers is that still relevant for me?
I am wondering if I should just use PHPUnit instead of Zend_Test
TIA,
S