public function testSessionCreation() { $factory = new SessionFactory(); $this->assertInstanceof('Zend\\ServiceManager\\FactoryInterface', $factory); $servicemanager = Bootstrap::getServiceManager(); $session = $factory->createService($servicemanager); $this->assertInstanceof('\\Zend\\Session\\Container', $session); }
public function testSessionCreation() { $factory = new HybridAuthFactory(); $this->assertInstanceof('Zend\\ServiceManager\\FactoryInterface', $factory); $servicemanager = Bootstrap::getServiceManager(); $_SERVER['SERVER_NAME'] = 'localhost'; $_SERVER['REQUEST_URI'] = 'http://localhost'; $_SERVER['HTTP_HOST'] = 'localhost'; $this->markTestIncomplete('Testing inomplete due to routing issues'); // $servicemanager->get('router')->addRoute('hybridauth/backend',array('options'=> array('route'=>'test'))); // $authInst = $factory->createService($servicemanager); // $this->assertInstanceof('\Hybrid_Auth', $authInst); }
public function testSessionCreation() { $factory = new IndexControllerFactory(); $this->assertInstanceof('Zend\\ServiceManager\\FactoryInterface', $factory); $servicemanager = Bootstrap::getServiceManager(); $_SERVER['SERVER_NAME'] = 'localhost'; $_SERVER['REQUEST_URI'] = 'http://localhost'; $_SERVER['HTTP_HOST'] = 'localhost'; $this->markTestIncomplete('Testing inomplete due to routing issues'); // $controller = $factory->createService($servicemanager); // $this->assertInstanceof('\OrgHeiglHybridAuth\Controller\IndexController', $controller); // $this->assertAttributeEquals($servicemanager->get('OrgHeiglHybridAuthSession'), 'session', $controller); // $this->assertAttributeEquals($servicemanager->get('OrgHeiglHybridAuthBackend'), 'authenticator', $controller); // $this->assertAttributeEquals($servicemanager->get('OrgHeiglHybridAuth\UserWrapperFactory'), 'userWrapperFactory', $controller); }
if ($previousDir === $dir) { return false; } $previousDir = $dir; } return $dir . '/' . $path; } /** * Access protected or private methods * * use the following code to access any protected or private class method * $obj = new MyClass(); * $method = UnitTestHelper::getMethod($obj, 'nameOfMethod'); * $result = $method->invoke('your',method,array('arguments')); * * @param Object|string $obj * @param string $name * * @return method */ public static function getMethod($obj, $name) { $class = new ReflectionClass($obj); $method = $class->getMethod($name); $method->setAccessible(true); return $method; } } session_start(); Bootstrap::init();