sendGET() public method

Sends a GET request to given uri.
See also: Codeception\Module\REST::sendGET()
public sendGET ( $url, array $params = null )
$url
$params array
<?php

/*
 * This file is part of the Webception package.
 *
 * (c) James Healey <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
$I = new WebGuy($scenario);
$I->wantTo('check AJAX call when the Codeception log check fails.');
$I->sendGET('logs?test=log_fail');
$I->seeResponseContainsJson(array('ready' => false, 'error' => "The Codeception Log directory does not exist. Please check the following path exists:"));
示例#2
0
<?php

/*
 * This file is part of the Webception package.
 *
 * (c) James Healey <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
$I = new WebGuy($scenario);
$I->wantTo('run a passing test');
$I->sendGET('run/acceptance/' . md5('acceptance' . 'TheTestThatPasses'));
$I->seeResponseContainsJson(array('message' => NULL, 'run' => true, 'passed' => true, 'state' => 'passed'));
<?php

/*
 * This file is part of the Webception package.
 *
 * (c) James Healey <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
$I = new WebGuy($scenario);
$I->wantTo('check AJAX call when executable fails');
$I->sendGET('executable?test=executable_fail');
$I->seeResponseContainsJson(array('ready' => false, 'error' => "The Codeception executable could not be found."));
<?php

/*
 * This file is part of the Webception package.
 *
 * (c) James Healey <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
$I = new WebGuy($scenario);
$I->wantTo('run test that does not exist to confirm the response');
$I->sendGET('run/lol/fake-test-id');
$I->seeResponseContainsJson(array('message' => 'The test could not be found.', 'run' => false, 'passed' => false, 'state' => 'error', 'log' => NULL));
<?php

/*
 * This file is part of the Webception package.
 *
 * (c) James Healey <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
$I = new WebGuy($scenario);
$I->wantTo('check AJAX call when executable passes.');
$I->sendGET('executable?test=pass');
$I->seeResponseContainsJson(array('ready' => true));
<?php

/*
 * This file is part of the Webception package.
 *
 * (c) James Healey <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
$I = new WebGuy($scenario);
$I->wantTo('check AJAX call when the Codeception log check passes.');
$I->sendGET('logs?test=pass');
$I->seeResponseContainsJson(array('ready' => true));