Testler çalışırken Düzeni eklentisi bulmak mümkün Zend_Test_PHPUnit_ControllerTestCase ve Zend_Layout,

0 Cevap php

Ben Zend Framework 1.10.6 ve Zend_Test_PHPUnit_ControllerTestCase kullanarak kontrolör sınıfları için bazı test durumlarda yazmak başlıyorum. Ben test durumlarda çalışırken, Zend_Controller_Action_HelperBroker Düzen eylem yardımcı bulmak değil ki, bir öğe ile ilgili sorunlar yaşıyorum.

İşte benim test davanın çıplak kemikleri vardır:

require_once 'PHPUnit/Framework.php';
require_once 'Zend/Test/PHPUnit/ControllerTestCase.php';
require_once 'controllers/IndexController.php';

class Application_Controllers_IndexControllerTest extends Zend_Test_PHPUnit_ControllerTestCase {

    public $_application;

    protected function setUp() {
        $this->bootstrap = array($this, 'appBootstrap');
        parent::setUp ();
    }

    public function appBootstrap() {
        // Create application, bootstrap, but don't run
        $this->_application = new Zend_Application(
            APPLICATION_ENV,
            APPLICATION_PATH . '/configs/application.ini'
        );
        $this->_application->bootstrap();
        $this->getFrontController()->setParams($this->_application->getOptions())
             ->addControllerDirectory(APPLICATION_PATH . '/controllers');
    }

    public function testIndexAction() {
        $this->dispatch('/index/index');
        $this->assertController('index');
        $this->assertAction('index');
    }

}

Ben test case çalıştırdığınızda bir istisna olsun:

Zend_Controller_Action_Exception: Aksiyon Yardımcısı adı Düzeni tarafından bulunamadı

Ben hattı 368 etrafında bu kaynağını bulmaya sınıf Zend_Controller_Action_HelperBroker iki satırları, ben alıyorum:

Zend_Loader_PluginLoader_Exception: Plugin by name 'Layout' was not found in the registry; used paths: Zend_Controller_Action_Helper_: Zend/Controller/Action/Helper/

Düzen komut yükleme çalışırken, bu PHPUnit altında testleri çalışırken Zend_Controller_Action_Helper için doğru yolu veya kayıt bulunamıyor ve bu nedenle Düzen eklenti yüklü olamaz görünür benim uygulamada çalışıyor.

Ben doğru Zend yüklü olduğu doğrulanmış ve Layout.php doğru yerde olduğunu var.

Herhangi bir fikir?

Del

0 Cevap