opensupports/server/tests/__mocks__/ReCaptchaMock.php

23 lines
609 B
PHP
Raw Normal View History

<?php
namespace ReCaptcha {
include_once 'tests/__lib__/Mock.php';
class ReCaptcha extends \Mock {
public static $functionList = array();
public static $verify;
public static function initVerify($value = true) {
2016-08-30 20:35:10 +02:00
self::$verify = \Mock::stub()->returns(new \Mock([
'isSuccess' => \Mock::stub()->returns($value)
]));
}
public function __construct($privateKey) {
parent::__construct();
$this->privateKey = $privateKey;
$this->verify = ReCaptcha::$verify;
}
}
}