You are here

public function SocketPostTest::testSubmitBadRequest in reCAPTCHA 6.2

File

recaptcha-php/tests/ReCaptcha/RequestMethod/SocketPostTest.php, line 80

Class

SocketPostTest

Namespace

ReCaptcha\RequestMethod

Code

public function testSubmitBadRequest() {
  $socket = $this
    ->getMock('\\ReCaptcha\\RequestMethod\\Socket', array(
    'fsockopen',
  ));
  $socket
    ->expects($this
    ->once())
    ->method('fsockopen')
    ->willReturn(false);
  $ps = new SocketPost($socket);
  $response = $ps
    ->submit(new RequestParameters("secret", "response", "remoteip", "version"));
  $this
    ->assertEquals(SocketPost::BAD_REQUEST, $response);
}