
PHPUnit Zend Framework
By: a guest on
Oct 15th, 2010 | syntax:
PHP | size: 0.75 KB | hits: 91 | expires: Never
<?php
require_once 'Zend/Test/PHPUnit/ControllerTestCase.php';
abstract class ControllerTestCase
extends Zend_Test_PHPUnit_ControllerTestCase
{
/**
* @var Zend_Application
*/
protected $application;
public function setUp()
{
$this->_setAppEnv();
$this->bootstrap = array($this, 'appBootstrap');
parent::setUp();
}
protected function _setAppEnv()
{
//put this here so you can override
defined('APPLICATION_ENV') || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'testing'));
}
public function appBootstrap()
{
$this->application = new Zend_Application(APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini');
$this->application->bootstrap();
}
}