2014-02-14 32 views

回答

0

它聽起來像一個命名空間問題。最有可能你的控制器在命名空間AlbumTest中,但你叫Bootstrap而不是\Bootstrap。不同之處在於後者會在您的名稱空間的根目錄中查找該目錄。

+0

這裏是我的AlbumControllerTest.php複製教程: – user3310847

+0

<?php namespace AlbumTest \ Controller; 使用AlbumTest \ Bootstrap; 使用Album \ Controller \ AlbumController; 使用Zend \ Http \ Request; 使用Zend \ Http \ Response; 使用Zend \ Mvc \ MvcEvent; 使用Zend \ Mvc \ Router \ RouteMatch; 使用Zend \ Mvc \ Router \ Http \ TreeRouteStack作爲HttpRouter; 使用PHPUnit_Framework_TestCase; class AlbumControllerTest extends PHPUnit_Framework_TestCase { protected $ controller; 保護$請求; 保護$迴應; protected $ routeMatch; 保護$事件; – user3310847

+0

我做到了!在../Album/test/Bootstrap.php我不得不改變:命名空間AlbumTest;//更改此名稱空間爲您的測試 – user3310847

相關問題