add authentication storage factory config and tests #41

Merged
merged 3 commits into from Oct 4, 2012
View
@@ -54,13 +54,12 @@
)
),
- 'authenticationadapter' => array(
+ 'authentication' => array(
'odm_default' => array(
'objectManager' => 'doctrine.documentmanager.odm_default',
'identityClass' => 'Application\Model\User',
'identityProperty' => 'username',
- 'credentialProperty' => 'password',
- 'credentialCallable' => 'Application\Model\User::hashPassword'
+ 'credentialProperty' => 'password'
),
),
),
@@ -106,7 +106,9 @@ public function getServiceConfig()
'Doctrine\ODM\Mongo\DocumentManager' => 'doctrine.documentmanager.odm_default',
),
'factories' => array(
- 'doctrine.authenticationadapter.odm_default' => new CommonService\AuthenticationAdapterFactory('odm_default'),
+ 'doctrine.authenticationadapter.odm_default' => new CommonService\Authentication\AdapterFactory('odm_default'),
+ 'doctrine.authenticationstorage.odm_default' => new CommonService\Authentication\StorageFactory('odm_default'),
+ 'doctrine.authenticationservice.odm_default' => new CommonService\Authentication\AuthenticationServiceFactory('odm_default'),
'doctrine.connection.odm_default' => new ODMService\ConnectionFactory('odm_default'),
'doctrine.configuration.odm_default' => new ODMService\ConfigurationFactory('odm_default'),
'doctrine.driver.odm_default' => new CommonService\DriverFactory('odm_default'),
@@ -0,0 +1,14 @@
+<?php
+
+namespace DoctrineMongoODMModuleTest\Doctrine;
+
+use DoctrineMongoODMModuleTest\AbstractTest;
+
+class AuthenticationAdapterFactoryTest extends AbstractTest
+{
+ public function testAuthenticationAdapterFactory(){
+
+ $adapter = $this->serviceManager->get('doctrine.authenticationadapter.odm_default');
+ $this->assertInstanceOf('Zend\Authentication\Adapter\AdapterInterface', $adapter);
+ }
+}
@@ -0,0 +1,14 @@
+<?php
+
+namespace DoctrineMongoODMModuleTest\Doctrine;
+
+use DoctrineMongoODMModuleTest\AbstractTest;
+
+class AuthenticationServiceFactoryTest extends AbstractTest
+{
+ public function testAuthenticationServiceFactory(){
+
+ $authenticationService = $this->serviceManager->get('doctrine.authenticationservice.odm_default');
+ $this->assertInstanceOf('Zend\Authentication\AuthenticationService', $authenticationService);
+ }
+}
@@ -0,0 +1,14 @@
+<?php
+
+namespace DoctrineMongoODMModuleTest\Doctrine;
+
+use DoctrineMongoODMModuleTest\AbstractTest;
+
+class AuthenticationStorageFactoryTest extends AbstractTest
+{
+ public function testAuthenticationStorageFactory(){
+
+ $storage = $this->serviceManager->get('doctrine.authenticationstorage.odm_default');
+ $this->assertInstanceOf('Zend\Authentication\Storage\StorageInterface', $storage);
+ }
+}