TYPO3 CMS  TYPO3_6-2
AuthenticationServiceTest.php
Go to the documentation of this file.
1 <?php
3 
22 
28  public function processLoginDataProvider() {
29  return array(
30  'Backend login with securityLevel "normal"' => array(
31  'normal',
32  array(
33  'status' => 'login',
34  'uname' => 'admin',
35  'uident' => 'password',
36  'chalvalue' => NULL
37  ),
38  array(
39  'status' => 'login',
40  'uname' => 'admin',
41  'uident' => 'password',
42  'chalvalue' => NULL,
43  'uident_text' => 'password',
44  'uident_challenged' => '458203772635d38f05ca9e62d8237974',
45  'uident_superchallenged' => '651219fccfbe0c9004c7196515d780ce'
46  )
47  ),
48  'Backend login with securityLevel "superchallenged"' => array(
49  'superchallenged',
50  array(
51  'status' => 'login',
52  'uname' => 'admin',
53  'uident' => '651219fccfbe0c9004c7196515d780ce',
54  'chalvalue' => NULL
55  ),
56  array(
57  'status' => 'login',
58  'uname' => 'admin',
59  'uident' => '651219fccfbe0c9004c7196515d780ce',
60  'chalvalue' => NULL,
61  'uident_text' => '',
62  'uident_challenged' => '',
63  'uident_superchallenged' => '651219fccfbe0c9004c7196515d780ce'
64  )
65  ),
66  'Frontend login with securityLevel "normal"' => array(
67  'normal',
68  array(
69  'status' => 'login',
70  'uname' => 'admin',
71  'uident' => 'password',
72  'chalvalue' => NULL
73  ),
74  array(
75  'status' => 'login',
76  'uname' => 'admin',
77  'uident' => 'password',
78  'chalvalue' => NULL,
79  'uident_text' => 'password',
80  'uident_challenged' => '458203772635d38f05ca9e62d8237974',
81  'uident_superchallenged' => '651219fccfbe0c9004c7196515d780ce'
82  )
83  ),
84  'Frontend login with securityLevel "challenged"' => array(
85  'challenged',
86  array(
87  'status' => 'login',
88  'uname' => 'admin',
89  'uident' => '458203772635d38f05ca9e62d8237974',
90  'chalvalue' => NULL
91  ),
92  array(
93  'status' => 'login',
94  'uname' => 'admin',
95  'uident' => '458203772635d38f05ca9e62d8237974',
96  'chalvalue' => NULL,
97  'uident_text' => '',
98  'uident_challenged' => '458203772635d38f05ca9e62d8237974',
99  'uident_superchallenged' => ''
100  )
101  )
102  );
103  }
104 
109  public function processLoginReturnsCorrectData($passwordSubmissionStrategy, $loginData, $expectedProcessedData) {
111  $authenticationService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Sv\\AuthenticationService');
112  // Login data is modified by reference
113  $authenticationService->processLoginData($loginData, $passwordSubmissionStrategy);
114  $this->assertEquals($expectedProcessedData, $loginData);
115  }
116 
117 }