TYPO3 CMS  TYPO3_8-7
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  */
19 
23 class AuthenticationServiceTest extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase
24 {
28  protected $subject;
29 
30  protected function setUp()
31  {
32  $this->subject = new AuthenticationService();
33  parent::setUp();
34  $this->importDataSet(ORIGINAL_ROOT . 'typo3/sysext/sv/Tests/Functional/Fixtures/be_users.xml');
35  }
36 
41  {
42  $this->subject->pObj = new BackendUserAuthentication();
43  $this->subject->login = [
44  'status' => 'login',
45  'uname' => 'test1',
46  'uident' => 'password',
47  'uident_text' => 'password',
48  ];
49  $this->subject->db_user = [
50  'table' => 'be_users',
51  'check_pid_clause' => '',
52  'enable_clause' => '',
53  'username_column' => 'username',
54  ];
55  $expected = [
56  'username' => 'test1',
57  'deleted' => 0
58  ];
59  $result = $this->subject->getUser();
60  $this->assertArraySubset($expected, $result);
61  }
62 }