(I re-post the subject because I wasn't in the mailing list when I first
posted it ! Sorry)

Hi !

So, here is my problem :

I try to test a Zend Framework application with PHPUnit.

All my tests extend the class "TestsController" you can see below :

class TestsController extends Zend_Test_PHPUnit_ControllerTestCase
{
       
        public function setUp()
    {  
       
        $this->bootstrap = new
Zend_Application(APPLICATION_ENV,APPLICATION_PATH .
'/configs/application.ini');
        $this->bootstrap->bootstrap(array(...module list...));
       //Setup Test's database
    }
   
    public function tearDown()
    {
      //delete test's database      
    }
}

Then, in an other file, I create my test Class which extends TestsController
:

class SomethingControllerTest extends TestsController
{
        public function Test1()
    {
    }

        public function Test2()
    {
    }

        public function Test3()
    {
    }
}

Every time a Test method is executed (Test1, Test2...), the plugins defined
in my config.ini are registered one more time by the Broker
(Zend_Controller_Plugin_Broker).

// config.ini excerpt
resources.frontController.plugins[] = "Plugin_First"
resources.frontController.plugins[] = "Plugin_Second"

How can I avoid it ?

Thanks for your help ! 
-- 
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Unit-Test-Plugins-loaded-multiple-times-tp3213501p3213501.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to