Added test create_custom_instance for Blocking Tor, VPN, Abusive and Country filters

This commit is contained in:
Zi Xing 2022-02-05 16:09:50 -05:00
parent 7a4354e306
commit fe7d09730f
2 changed files with 14 additions and 1 deletions

View File

@ -160,7 +160,7 @@
throw new InvalidCaptchaNameException('The given name must not be greater than 120 characters or less than 3 and must be alphanumeric.');
$captchaInstance->LastUpdatedTimestamp = time();
$firewall_options = $captchaInstance->FirewallOptions->toArray()['firewall_options'];
$firewall_options = $captchaInstance->FirewallOptions->toArray();
$Query = QueryBuilder::update('instances', [
'name' => $this->vcaptcha->getDatabase()->real_escape_string(urlencode($captchaInstance->Name)),

View File

@ -0,0 +1,13 @@
<?php
require 'ppm';
require 'net.intellivoid.vcaptcha';
$vcaptcha = new \vCaptcha\vCaptcha();
$instance = $vcaptcha->getCaptchaInstanceManager()->createInstance(\vCaptcha\Abstracts\CaptchaType::None, 'netkas', 'Example');
$instance->FirewallOptions->DisallowTor = true;
$instance->FirewallOptions->DisallowAbusiveHosts = true;
$instance->FirewallOptions->HostMismatchProtection = true;
$instance = $vcaptcha->getCaptchaInstanceManager()->updateInstance($instance);
var_dump($instance);