‪TYPO3CMS  10.4
AuthenticationServiceTest.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Psr\Log\NullLogger;
23 use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
24 
28 class ‪AuthenticationServiceTest extends FunctionalTestCase
29 {
33  protected ‪$subject;
34 
35  protected function ‪setUp(): void
36  {
37  $this->subject = new ‪AuthenticationService();
38  $this->subject->setLogger(new NullLogger());
39  parent::setUp();
40  $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/core/Tests/Functional/Fixtures/be_users.xml');
41  }
42 
47  {
48  $this->subject->pObj = new ‪BackendUserAuthentication();
49  $this->subject->login = [
50  'status' => 'login',
51  'uname' => 'test1',
52  'uident' => 'password',
53  'uident_text' => 'password',
54  ];
55  $this->subject->db_user = [
56  'table' => 'be_users',
57  'check_pid_clause' => '',
58  'enable_clause' => '',
59  'username_column' => 'username',
60  ];
61  $result = $this->subject->getUser();
62  self::assertSame('test1', $result['username']);
63  self::assertSame(0, (int)$result['deleted']);
64  }
65 }
‪TYPO3\CMS\Core\Tests\Functional\Authentication\AuthenticationServiceTest\setUp
‪setUp()
Definition: AuthenticationServiceTest.php:34
‪TYPO3\CMS\Core\Tests\Functional\Authentication\AuthenticationServiceTest
Definition: AuthenticationServiceTest.php:29
‪TYPO3\CMS\Core\Tests\Functional\Authentication\AuthenticationServiceTest\$subject
‪AuthenticationService $subject
Definition: AuthenticationServiceTest.php:32
‪TYPO3\CMS\Core\Tests\Functional\Authentication
Definition: AbstractUserAuthenticationTest.php:18
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Core\Authentication\AuthenticationService
Definition: AuthenticationService.php:33
‪TYPO3\CMS\Core\Tests\Functional\Authentication\AuthenticationServiceTest\getUserReturnsOnlyNotDeletedRecords
‪getUserReturnsOnlyNotDeletedRecords()
Definition: AuthenticationServiceTest.php:45