TYPO3 CMS  TYPO3_8-7
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 
20 class AuthenticationServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
21 {
27  public function processLoginDataProvider()
28  {
29  return [
30  'Backend login with securityLevel "normal"' => [
31  'normal',
32  [
33  'status' => 'login',
34  'uname' => 'admin',
35  'uident' => 'password',
36  ],
37  [
38  'status' => 'login',
39  'uname' => 'admin',
40  'uident' => 'password',
41  'uident_text' => 'password',
42  ]
43  ],
44  'Frontend login with securityLevel "normal"' => [
45  'normal',
46  [
47  'status' => 'login',
48  'uname' => 'admin',
49  'uident' => 'password',
50  ],
51  [
52  'status' => 'login',
53  'uname' => 'admin',
54  'uident' => 'password',
55  'uident_text' => 'password',
56  ]
57  ],
58  ];
59  }
60 
65  public function processLoginReturnsCorrectData($passwordSubmissionStrategy, $loginData, $expectedProcessedData)
66  {
68  $authenticationService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Sv\AuthenticationService::class);
69  // Login data is modified by reference
70  $authenticationService->processLoginData($loginData, $passwordSubmissionStrategy);
71  $this->assertEquals($expectedProcessedData, $loginData);
72  }
73 }
static makeInstance($className,... $constructorArguments)