-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_gethtml.phpt
55 lines (47 loc) · 2.22 KB
/
test_gethtml.phpt
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--TEST--
Test for Services_ReCaptcha::getHTML() method.
--FILE--
<?php
require_once 'Services/ReCaptcha.php';
$recaptcha = new Services_ReCaptcha('public_key', 'private_key');
echo $recaptcha . "\n";
$recaptcha->setOption('secure', true);
$recaptcha->setOption('theme', 'white');
$recaptcha->setOption('lang', 'fr');
$recaptcha->setOption('custom_translations', array('instructions_visual' => "foo"));
$recaptcha->setError('incorrect-captcha-sol');
echo $recaptcha . "\n";
$recaptcha->setOption('xhtml', false);
echo $recaptcha . "\n";
?>
--EXPECT--
<script type="text/javascript" src="https://www.google.com/recaptcha/api/challenge?k=public_key"></script>
<noscript>
<iframe src="https://www.google.com/recaptcha/api/noscript?k=public_key" height="300" width="500" frameborder="0">
</iframe>
<br/>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
</noscript>
<script type="text/javascript">
var RecaptchaOptions = {"theme":"white","lang":"fr","custom_translations":{"instructions_visual":"foo"}};
</script>
<script type="text/javascript" src="https://www.google.com/recaptcha/api/challenge?k=public_key&error=incorrect-captcha-sol"></script>
<noscript>
<iframe src="https://www.google.com/recaptcha/api/noscript?k=public_key&error=incorrect-captcha-sol" height="300" width="500" frameborder="0">
</iframe>
<br/>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
</noscript>
<script type="text/javascript">
var RecaptchaOptions = {"theme":"white","lang":"fr","custom_translations":{"instructions_visual":"foo"}};
</script>
<script type="text/javascript" src="https://www.google.com/recaptcha/api/challenge?k=public_key&error=incorrect-captcha-sol"></script>
<noscript>
<iframe src="https://www.google.com/recaptcha/api/noscript?k=public_key&error=incorrect-captcha-sol" height="300" width="500" frameborder="0">
</iframe>
<br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge">
</noscript>