summaryrefslogtreecommitdiffstats
path: root/tests/Stubs/Render.php
blob: 774d8306b01327f50171209507abede0625e38f6 (plain) (blame)
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
32
33
34
35
<?php

class Render
{
	public static array $templates = [];
	public static ?string $lastTitle = null;

	public static function reset(): void
	{
		self::$templates = [];
		self::$lastTitle = null;
	}

	public static function addTemplate(string $name, array $data = []): void
	{
		self::$templates[] = ['name' => $name, 'data' => $data];
	}

	public static function setTitle(string $title): void
	{
		self::$lastTitle = $title;
	}

	public static function addInfo(string $key, ...$args): void
	{
		Message::$infos[] = $key;
	}

	// Parser used by permissionmanager role editor helpers and Paginate::render
	public static function parse(string $template, array $data = [], ...$rest): string
	{
		// For testing, just return an identifiable placeholder
		return '<parsed:' . $template . '>';
	}
}