Permalink
Browse files

add authentication storage factory config and tests

  • Loading branch information...
1 parent 69d3a95 commit cc3f1aa4b1732519eb706988372f4e08bd1c49ba @superdweebie superdweebie committed Sep 30, 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'
),
),
),
@@ -107,6 +107,7 @@ public function getServiceConfig()
),
'factories' => array(
'doctrine.authenticationadapter.odm_default' => new CommonService\AuthenticationAdapterFactory('odm_default'),
+ 'doctrine.authenticationstorage.odm_default' => new CommonService\AuthenticationStorageFactory('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,15 @@
+<?php
+
+namespace DoctrineMongoODMModuleTest\Doctrine;
+
+use DoctrineMongoODMModuleTest\AbstractTest;
+use Zend\Authentication\Adapter\AdapterInterface;
+
+class AuthenticationAdapterFactoryTest extends AbstractTest
+{
+ public function testAuthenticationAdapterFactory(){
+
+ $adapter = $this->serviceManager->get('doctrine.authenticationadapter.odm_default');
+ $this->assertTrue($adapter instanceof AdapterInterface);
+ }
+}
@@ -0,0 +1,15 @@
+<?php
+
+namespace DoctrineMongoODMModuleTest\Doctrine;
+
+use DoctrineMongoODMModuleTest\AbstractTest;
+use Zend\Authentication\Storage\StorageInterface;
+
+class AuthenticationStorageFactoryTest extends AbstractTest
+{
+ public function testAuthenticationStorageFactory(){
+
+ $storage = $this->serviceManager->get('doctrine.authenticationstorage.odm_default');
+ $this->assertTrue($storage instanceof StorageInterface);
+ }
+}

0 comments on commit cc3f1aa

Please sign in to comment.