Are you having problems with just your library code, or Zend library too?
I have this at the end of my bootstrap.php:
Zend_Loader_Autoloader::getInstance()
->registerNamespace("MyApp");
Konr
On Wed, Nov 2, 2011 at 10:24 AM, robert mena <[email protected]> wrote:
> Hi, I am using zf.sh to create my controllers/models/actions so my
> test classes all inherit from Zend_Test_PHPUnit_ControllerTestCase.
>
> My problem is that for some reason the objects that I try to
> instantiate only work if I do a require/include. The include path is
> correct since I do not have to specify the whole path just include
> 'MyApp/Foo.php' for MyApp_Foo class
>
> this is the result from print_r(spl_autoload_functions())
>
> Array
> (
> [0] => phpunit_autoload
> [1] => Array
> (
> [0] => Zend_Loader_Autoloader
> [1] => autoload
> )
>
> )
>
> My phpunit.xml
>
> <phpunit bootstrap="./bootstrap.php">
> <testsuite name="Application Test Suite">
> <directory>./application</directory>
> </testsuite>
> <testsuite name="Library Test Suite">
> <directory>./library</directory>
> </testsuite>
>
> <filter>
> <whitelist>
> <directory suffix=".php">../../library/Doctrine</directory>
> <directory suffix=".php">../../library/Utils</directory>
> <directory suffix=".php">../../library/Smarty</directory>
> <directory suffix=".php">../../library/HTMLPurifier</directory>
> </whitelist>
> </filter>
> </phpunit>
>
> The bootstrap.php
>
> // 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') : 'testing'));
>
> // Ensure library/ is on include_path
> set_include_path(implode(PATH_SEPARATOR, array(
> realpath(APPLICATION_PATH . '/../library'),
> get_include_path(),
> )));
>
> require_once 'Zend/Loader/Autoloader.php';
> Zend_Loader_Autoloader::getInstance();
>
> --
> List: [email protected]
> Info: http://framework.zend.com/archives
> Unsubscribe: [email protected]
>
>
>
--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]