CredentialsTest.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace Test\Authentication\LoginCredentials;
  7. use OC\Authentication\LoginCredentials\Credentials;
  8. use Test\TestCase;
  9. class CredentialsTest extends TestCase {
  10. /** @var string */
  11. private $uid;
  12. /** @var string */
  13. private $user;
  14. /** @var string */
  15. private $password;
  16. /** @var Credentials */
  17. private $credentials;
  18. protected function setUp(): void {
  19. parent::setUp();
  20. $this->uid = 'user123';
  21. $this->user = 'User123';
  22. $this->password = '123456';
  23. $this->credentials = new Credentials($this->uid, $this->user, $this->password);
  24. }
  25. public function testGetUID(): void {
  26. $this->assertEquals($this->uid, $this->credentials->getUID());
  27. }
  28. public function testGetUserName(): void {
  29. $this->assertEquals($this->user, $this->credentials->getLoginName());
  30. }
  31. public function testGetPassword(): void {
  32. $this->assertEquals($this->password, $this->credentials->getPassword());
  33. }
  34. }