@@ -728,7 +728,32 @@ function testAllowDenyAll() {
728
728
$ this ->Controller ->params ['action ' ] = 'Add ' ;
729
729
$ this ->assertFalse ($ this ->Controller ->Auth ->startup ($ this ->Controller ));
730
730
}
731
+ /**
732
+ * test that allow() and allowedActions work with camelCase method names.
733
+ *
734
+ * @return void
735
+ **/
736
+ function testAllowedActionsWithCamelCaseMethods () {
737
+ $ url = '/auth_test/camelCase ' ;
738
+ $ this ->Controller ->params = Router::parse ($ url );
739
+ $ this ->Controller ->params ['url ' ]['url ' ] = Router::normalize ($ url );
740
+ $ this ->Controller ->Auth ->initialize ($ this ->Controller );
741
+ $ this ->Controller ->Auth ->loginAction = array ('controller ' => 'AuthTest ' , 'action ' => 'login ' );
742
+ $ this ->Controller ->Auth ->userModel = 'AuthUser ' ;
743
+ $ this ->Controller ->Auth ->allow ('* ' );
744
+ $ result = $ this ->Controller ->Auth ->startup ($ this ->Controller );
745
+ $ this ->assertTrue ($ result , 'startup() should return true, as action is allowed. %s ' );
731
746
747
+ $ url = '/auth_test/camelCase ' ;
748
+ $ this ->Controller ->params = Router::parse ($ url );
749
+ $ this ->Controller ->params ['url ' ]['url ' ] = Router::normalize ($ url );
750
+ $ this ->Controller ->Auth ->initialize ($ this ->Controller );
751
+ $ this ->Controller ->Auth ->loginAction = array ('controller ' => 'AuthTest ' , 'action ' => 'login ' );
752
+ $ this ->Controller ->Auth ->userModel = 'AuthUser ' ;
753
+ $ this ->Controller ->Auth ->allowedActions = array ('delete ' , 'camelCase ' , 'add ' );
754
+ $ result = $ this ->Controller ->Auth ->startup ($ this ->Controller );
755
+ $ this ->assertTrue ($ result , 'startup() should return true, as action is allowed. %s ' );
756
+ }
732
757
/**
733
758
* testLoginRedirect method
734
759
*
0 commit comments