aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Files/Template/FieldTest.php
blob: 212603a881bb03a8049bc18c161f1c607926b5ea (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
<?php

declare(strict_types = 1);

namespace Test\Files\Template;

use OCP\Files\Template\Field;
use OCP\Files\Template\FieldType;

class FieldTest extends \Test\TestCase {
	protected function setUp(): void {
		parent::setUp();
	}

	public function testJsonSerialize(): void {
		$field = new Field("name", "Nextcloud", FieldType::RichText);

		$this->assertJsonStringEqualsJsonString(
			json_encode($field->jsonSerialize()),
			json_encode([
				"index" => "name",
				"content" => "Nextcloud",
				"type" => "rich-text",
				"alias" => null,
				"id" => null,
				"tag" => null,
			])
		);
	}
}