aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/Module/Admin/SecurityTest.php
blob: 238cf7f82696adb3407f63e9aad4bb760f39a73e (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
<?php

declare(strict_types=1);

class SecurityTest extends \Zotlabs\Tests\Unit\Module\TestCase {
	public function testSetBlockedSites(): void {
		\App::$observer = array(
			'xchan_guid' => 'testguid',
			'xchan_name' => 'anonymous',
			'xchan_hash' => 'testhash',
		);

		$this->post('admin/security', [
			'whitelisted_sites' => '',
			'blacklisted_sites' => "test.com\nbadsite.net",
			'whitelisted_channels' => '',
			'blacklisted_channels' => '',
			'embed_allow' => '',
			'embed_deny' => '',
			'trusted_directory_servers' => '',
			'form_security_token' => get_form_security_token('admin_security'),
		]);


		$this->assertEquals(
			\Zotlabs\Lib\Config::Get('system', 'blacklisted_sites'),
			array('test.com', 'badsite.net')
		);
	}
}