Добавлен API вызов для получения активного Recaptcha public key

This commit is contained in:
ErickSkrauch
2016-08-03 15:58:12 +03:00
parent c2986445f1
commit 5e40ccbe49
7 changed files with 85 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
<?php
namespace tests\codeception\api\_pages;
use yii\codeception\BasePage;
/**
* @property \tests\codeception\api\FunctionalTester $actor
*/
class OptionsRoute extends BasePage {
public function recaptchaPublicKey() {
$this->route = ['options/recaptcha-public-key'];
$this->actor->sendGET($this->getUrl());
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace codeception\api\functional;
use tests\codeception\api\_pages\OptionsRoute;
use tests\codeception\api\FunctionalTester;
class OptionsCest {
/**
* @var OptionsRoute
*/
private $route;
public function _before(FunctionalTester $I) {
$this->route = new OptionsRoute($I);
}
public function testRecaptchaPublicKey(FunctionalTester $I) {
$I->wantTo('Get recaptcha public key');
$this->route->recaptchaPublicKey();
$I->canSeeResponseCodeIs(200);
// TODO: эта проверка не проходит, т.к внутри почему-то после запроса не устанавливаются http заголовки
//$I->seeHttpHeader('Content-Type', 'text/html; charset=UTF-8');
$I->canSeeResponseEquals('public-key');
}
}