File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ public function testConstruct()
2121 $ this ->assertArrayHasKey ('newIdentity ' , $ inputs );
2222 $ this ->assertArrayHasKey ('newIdentityVerify ' , $ inputs );
2323
24- $ this ->assertEquals (0 , $ inputs ['identity ' ]->getValidatorChain ()->count ());
24+ $ validators = $ inputs ['identity ' ]->getValidatorChain ()->getValidators ();
25+ $ this ->assertArrayHasKey ('instance ' , $ validators [0 ]);
26+ $ this ->assertInstanceOf ('\Zend\Validator\EmailAddress ' , $ validators [0 ]['instance ' ]);
2527 }
2628
2729 /**
@@ -32,7 +34,7 @@ public function testConstructIdentityEmail($onlyEmail)
3234 $ options = $ this ->getMock ('ZfcUser\Options\ModuleOptions ' );
3335 $ options ->expects ($ this ->once ())
3436 ->method ('getAuthIdentityFields ' )
35- ->will ($ this ->returnValue (array ('email ' )));
37+ ->will ($ this ->returnValue (( $ onlyEmail ) ? array ('email ' ) : array ( ' username ' )));
3638
3739 $ validator = $ this ->getMockBuilder ('ZfcUser\Validator\NoRecordExists ' )->disableOriginalConstructor ()->getMock ();
3840 $ filter = new Filter ($ options , $ validator );
Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ public function testConstruct()
2121 $ this ->assertArrayHasKey ('newCredential ' , $ inputs );
2222 $ this ->assertArrayHasKey ('newCredentialVerify ' , $ inputs );
2323
24- $ this ->assertEquals (0 , $ inputs ['identity ' ]->getValidatorChain ()->count ());
24+ $ validators = $ inputs ['identity ' ]->getValidatorChain ()->getValidators ();
25+ $ this ->assertArrayHasKey ('instance ' , $ validators [0 ]);
26+ $ this ->assertInstanceOf ('\Zend\Validator\EmailAddress ' , $ validators [0 ]['instance ' ]);
2527 }
2628
2729 /**
@@ -32,7 +34,7 @@ public function testConstructIdentityEmail($onlyEmail)
3234 $ options = $ this ->getMock ('ZfcUser\Options\ModuleOptions ' );
3335 $ options ->expects ($ this ->once ())
3436 ->method ('getAuthIdentityFields ' )
35- ->will ($ this ->returnValue ($ onlyEmail ? array ('email ' ) : array ()));
37+ ->will ($ this ->returnValue ($ onlyEmail ? array ('email ' ) : array (' username ' )));
3638
3739 $ filter = new Filter ($ options );
3840
You can’t perform that action at this time.
0 commit comments