mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Перенесены тесты со старого authserver, исправлены ошибки в коде
This commit is contained in:
36
tests/codeception/api/_pages/AuthserverRoute.php
Normal file
36
tests/codeception/api/_pages/AuthserverRoute.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
namespace tests\codeception\api\_pages;
|
||||
|
||||
use yii\codeception\BasePage;
|
||||
|
||||
/**
|
||||
* @property \tests\codeception\api\FunctionalTester $actor
|
||||
*/
|
||||
class AuthserverRoute extends BasePage {
|
||||
|
||||
public function authenticate($params) {
|
||||
$this->route = ['authserver/authentication/authenticate'];
|
||||
$this->actor->sendPOST($this->getUrl(), $params);
|
||||
}
|
||||
|
||||
public function refresh($params) {
|
||||
$this->route = ['authserver/authentication/refresh'];
|
||||
$this->actor->sendPOST($this->getUrl(), $params);
|
||||
}
|
||||
|
||||
public function validate($params) {
|
||||
$this->route = ['authserver/authentication/validate'];
|
||||
$this->actor->sendPOST($this->getUrl(), $params);
|
||||
}
|
||||
|
||||
public function invalidate($params) {
|
||||
$this->route = ['authserver/authentication/invalidate'];
|
||||
$this->actor->sendPOST($this->getUrl(), $params);
|
||||
}
|
||||
|
||||
public function signout($params) {
|
||||
$this->route = ['authserver/authentication/signout'];
|
||||
$this->actor->sendPOST($this->getUrl(), $params);
|
||||
}
|
||||
|
||||
}
|
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace tests\codeception\api\_pages;
|
||||
|
||||
use yii\codeception\BasePage;
|
||||
|
||||
/**
|
||||
* Represents contact page
|
||||
* @property \tests\codeception\api\FunctionalTester $actor
|
||||
*/
|
||||
class ContactPage extends BasePage {
|
||||
|
||||
public $route = 'site/contact';
|
||||
|
||||
/**
|
||||
* @param array $contactData
|
||||
*/
|
||||
public function submit(array $contactData) {
|
||||
foreach ($contactData as $field => $value) {
|
||||
$inputType = $field === 'body' ? 'textarea' : 'input';
|
||||
$this->actor->fillField($inputType . '[name="ContactForm[' . $field . ']"]', $value);
|
||||
}
|
||||
$this->actor->click('contact-button');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user