TYPO3 CMS  TYPO3_7-6
AuthenticationServiceTest.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
22 {
28  public function processLoginDataProvider()
29  {
30  return [
31  'Backend login with securityLevel "normal"' => [
32  'normal',
33  [
34  'status' => 'login',
35  'uname' => 'admin',
36  'uident' => 'password',
37  ],
38  [
39  'status' => 'login',
40  'uname' => 'admin',
41  'uident' => 'password',
42  'uident_text' => 'password',
43  ]
44  ],
45  'Frontend login with securityLevel "normal"' => [
46  'normal',
47  [
48  'status' => 'login',
49  'uname' => 'admin',
50  'uident' => 'password',
51  ],
52  [
53  'status' => 'login',
54  'uname' => 'admin',
55  'uident' => 'password',
56  'uident_text' => 'password',
57  ]
58  ],
59  ];
60  }
61 
66  public function processLoginReturnsCorrectData($passwordSubmissionStrategy, $loginData, $expectedProcessedData)
67  {
69  $authenticationService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Sv\AuthenticationService::class);
70  // Login data is modified by reference
71  $authenticationService->processLoginData($loginData, $passwordSubmissionStrategy);
72  $this->assertEquals($expectedProcessedData, $loginData);
73  }
74 }