Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * An apex page controller that exposes the site login functionality
- */
- global with sharing class CommunitiesLoginController {
- global CommunitiesLoginController () {}
- // Code we will invoke on page load.
- global PageReference forwardToAuthPage() {
- String startUrl = System.currentPageReference().getParameters().get('startURL');
- String displayType = System.currentPageReference().getParameters().get('display');
- return Network.forwardToAuthPage(startUrl, displayType);
- }
- // Code we will invoke on page load.
- global PageReference forwardToCustomAuthPage() {
- return new PageReference('/CustomLoginPage');
- }
- }
- /**
- * An apex page controller that exposes the site login functionality
- */
- @IsTest global with sharing class CommunitiesLoginControllerTest {
- @IsTest(SeeAllData=true)
- global static void testCommunitiesLoginController () {
- CommunitiesLoginController controller = new CommunitiesLoginController();
- System.assertEquals(null, controller.forwardToAuthPage());
- PageReference p = new PageReference ('/CustomLoginPage');
- System.assertEquals( p, controller.forwardToCustomAuthPage());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement