aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/unit/Module/Admin/SecurityTest.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/unit/Module/Admin/SecurityTest.php b/tests/unit/Module/Admin/SecurityTest.php
new file mode 100644
index 000000000..238cf7f82
--- /dev/null
+++ b/tests/unit/Module/Admin/SecurityTest.php
@@ -0,0 +1,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')
+ );
+ }
+}