0
我學習framework2和我下面這個:PHP致命錯誤:類 'AlbumTest 引導' 未找到
http://framework.zend.com/manual/2.0/en/user-guide/routing-and-controllers.html
但我發現了這個錯誤:
PHP Fatal error: Class 'AlbumTest\Bootstrap' not found in /home/ben/ZendSkeletonApplication/path/to/zf2-tutorial/module/Album/test/AlbumTest/Controller/AlbumControllerTest.php on line 23
這裏是我的AlbumControllerTest.php複製教程: – user3310847
<?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
我做到了!在../Album/test/Bootstrap.php我不得不改變:命名空間AlbumTest;//更改此名稱空間爲您的測試 – user3310847