CloudIdTest.php 722 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace Test\Federation;
  7. use OC\Federation\CloudId;
  8. use Test\TestCase;
  9. class CloudIdTest extends TestCase {
  10. public function dataGetDisplayCloudId() {
  11. return [
  12. ['test@example.com', 'test@example.com'],
  13. ['test@http://example.com', 'test@example.com'],
  14. ['test@https://example.com', 'test@example.com'],
  15. ];
  16. }
  17. /**
  18. * @dataProvider dataGetDisplayCloudId
  19. *
  20. * @param string $id
  21. * @param string $display
  22. */
  23. public function testGetDisplayCloudId($id, $display) {
  24. $cloudId = new CloudId($id, '', '');
  25. $this->assertEquals($display, $cloudId->getDisplayId());
  26. }
  27. }