Initial commit,修正
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace tests\codeception\_pages;
|
||||
|
||||
use yii\codeception\BasePage;
|
||||
|
||||
/**
|
||||
* Represents create role or permission
|
||||
* @property \AcceptanceTester|\FunctionalTester $actor
|
||||
*/
|
||||
class CreateItemPage extends BasePage
|
||||
{
|
||||
public $route = 'admin/role/create';
|
||||
|
||||
/**
|
||||
* @param array $roleData
|
||||
*/
|
||||
public function submit(array $roleData)
|
||||
{
|
||||
$inputTypes = [
|
||||
'name' => 'input',
|
||||
'description' => 'textarea',
|
||||
'ruleName' => 'select',
|
||||
'data' => 'textarea',
|
||||
];
|
||||
foreach ($roleData as $field => $value) {
|
||||
$inputType = isset($inputTypes[$field]) ? $inputTypes[$field] : 'input';
|
||||
$this->actor->fillField($inputType . '[name="AuthItem[' . $field . ']"]', $value);
|
||||
}
|
||||
$this->actor->click('submit-button');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user