aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Federation/CloudIdTest.php
blob: 4087f45622d38669f3c8ca9736e3c71d0e92c976 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
/**
 * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

namespace Test\Federation;

use OC\Federation\CloudId;
use Test\TestCase;

class CloudIdTest extends TestCase {
	public function dataGetDisplayCloudId() {
		return [
			['test@example.com', 'test@example.com'],
			['test@http://example.com', 'test@example.com'],
			['test@https://example.com', 'test@example.com'],
		];
	}

	/**
	 * @dataProvider dataGetDisplayCloudId
	 *
	 * @param string $id
	 * @param string $display
	 */
	public function testGetDisplayCloudId($id, $display): void {
		$cloudId = new CloudId($id, '', '');
		$this->assertEquals($display, $cloudId->getDisplayId());
	}
}