‪TYPO3CMS  9.5
AuthenticationServiceTest.php
Go to the documentation of this file.
1 <?php
2 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 use Psr\Log\NullLogger;
20 
24 class ‪AuthenticationServiceTest extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase
25 {
29  protected ‪$subject;
30 
31  protected function ‪setUp()
32  {
33  $this->subject = new ‪AuthenticationService();
34  $this->subject->setLogger(new NullLogger());
35  parent::setUp();
36  $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/core/Tests/Functional/Fixtures/be_users.xml');
37  }
38 
43  {
44  $this->subject->pObj = new ‪BackendUserAuthentication();
45  $this->subject->login = [
46  'status' => 'login',
47  'uname' => 'test1',
48  'uident' => 'password',
49  'uident_text' => 'password',
50  ];
51  $this->subject->db_user = [
52  'table' => 'be_users',
53  'check_pid_clause' => '',
54  'enable_clause' => '',
55  'username_column' => 'username',
56  ];
57  $expected = [
58  'username' => 'test1',
59  'deleted' => 0
60  ];
61  $result = $this->subject->getUser();
62  $this->assertArraySubset($expected, $result);
63  }
64 }
‪TYPO3\CMS\Core\Tests\Functional\Authentication\AuthenticationServiceTest\setUp
‪setUp()
Definition: AuthenticationServiceTest.php:30
‪TYPO3\CMS\Core\Tests\Functional\Authentication\AuthenticationServiceTest
Definition: AuthenticationServiceTest.php:25
‪TYPO3\CMS\Core\Tests\Functional\Authentication\AuthenticationServiceTest\$subject
‪AuthenticationService $subject
Definition: AuthenticationServiceTest.php:28
‪TYPO3\CMS\Core\Tests\Functional\Authentication
Definition: AbstractUserAuthenticationTest.php:3
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:45
‪TYPO3\CMS\Core\Authentication\AuthenticationService
Definition: AuthenticationService.php:30
‪TYPO3\CMS\Core\Tests\Functional\Authentication\AuthenticationServiceTest\getUserReturnsOnlyNotDeletedRecords
‪getUserReturnsOnlyNotDeletedRecords()
Definition: AuthenticationServiceTest.php:41