Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #41 from superdweebie/storageFactory

add authentication storage factory config and tests
  • Loading branch information...
commit 9b02c3af2e9c5ac95bc18cbed08d3ddf4e64d72d 2 parents 6caa305 + ee732e2
@Ocramius Ocramius authored
View
5 config/module.config.php
@@ -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'
),
),
),
View
4 src/DoctrineMongoODMModule/Module.php
@@ -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'),
View
14 tests/DoctrineMongoODMModuleTest/Doctrine/AuthenticationAdapterFactoryTest.php
@@ -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);
+ }
+}
View
14 tests/DoctrineMongoODMModuleTest/Doctrine/AuthenticationServiceFactoryTest.php
@@ -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);
+ }
+}
View
14 tests/DoctrineMongoODMModuleTest/Doctrine/AuthenticationStorageFactoryTest.php
@@ -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);
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.