@@ -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 );
@@ -47,11 +49,6 @@ public function testConstructIdentityEmail($onlyEmail)
4749 if ($ onlyEmail === false ) {
4850 $ this ->assertEquals (0 , $ inputs ['identity ' ]->getValidatorChain ()->count ());
4951 } else {
50- // @todo remove this test skip if #383 is fixed
51- if ($ identity instanceof \Zend \InputFilter \Input && $ identity ->getValidatorChain ()->count () == 0 ) {
52- $ this ->markTestSkipped ("currently we have a bug in this validator, pls fix #383 " );
53- }
54-
5552 // test email as identity
5653 $ validators = $ identity ->getValidatorChain ()->getValidators ();
5754 $ this ->assertArrayHasKey ('instance ' , $ validators [0 ]);
0 commit comments