PHPUnit: Test an an factory class with a dependency

nicwlzz

New Member
I've got following factory class which has a dependency $client. I moved the dependency to the factory class as it first occurred in Service_Service1 class so I could test the service class. But how can I test the factory class?\[code\]class Factory implements Service{ public static function factory($service) { $config = Zend_Registry::get('config'); switch ($service) { case Service::Service1: $client = new Zend_Soap_Client( $config->url, array( 'encoding' => 'UTF-8' ) ); $pickupPoint = new Service_Service1($client); break; } }}\[/code\]
 
Back
Top