File: SimpleTest.php

package info (click to toggle)
google-recaptcha 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 436 kB
  • sloc: php: 1,115; makefile: 9
file content (27 lines) | stat: -rw-r--r-- 701 bytes parent folder | download
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
<?php

declare(strict_types = 1);

use \PHPUnit\Framework\TestCase;
use \ReCaptcha\ReCaptcha;

require_once __DIR__ . '/FakeCheck.php';

final class SimpleTest extends TestCase
{
    public function testImplementation(): void
    {
        $secret = 'xxxxxxx';
        $requestMethod = new FakeCheck();
        $recaptcha = new \ReCaptcha\ReCaptcha($secret, $requestMethod);
        $this->assertSame([
            'success' => true,
            'hostname' => 'debian.local',
            'challenge_ts' => '',
            'apk_package_name' => '',
            'score' => null,
            'action' => '',
            'error-codes' => [],
        ], $recaptcha->verify('response')->toArray());
    }
}