Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
bf5bb373
Commit
bf5bb373
authored
Feb 07, 2014
by
Mark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests improved
parent
81f36ec2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
ContactPage.php
apps/basic/tests/_pages/ContactPage.php
+9
-4
LoginPage.php
apps/basic/tests/_pages/LoginPage.php
+3
-4
No files found.
apps/basic/tests/_pages/ContactPage.php
View file @
bf5bb373
...
@@ -13,10 +13,15 @@ class ContactPage extends BasePage
...
@@ -13,10 +13,15 @@ class ContactPage extends BasePage
*/
*/
public
function
submit
(
array
$contactData
)
public
function
submit
(
array
$contactData
)
{
{
$data
=
[];
foreach
(
$contactData
as
$field
=>
$value
)
{
foreach
(
$contactData
as
$name
=>
$value
)
{
if
(
in_array
(
$field
,
[
'name'
,
'email'
,
'subject'
,
'verifyCode'
]))
{
$data
[
"ContactForm[
$name
]"
]
=
$value
;
$this
->
guy
->
fillField
(
'input[name="ContactForm['
.
$field
.
']"]'
,
$value
);
}
}
}
$this
->
guy
->
submitForm
(
'#contact-form'
,
$data
);
if
(
isset
(
$contactData
[
'body'
]))
{
$this
->
guy
->
fillField
(
'textarea[name="ContactForm[body]"]'
,
$contactData
[
'body'
]);
}
$this
->
guy
->
click
(
'Submit'
,
'#contact-form'
);
}
}
}
}
apps/basic/tests/_pages/LoginPage.php
View file @
bf5bb373
...
@@ -14,9 +14,8 @@ class LoginPage extends BasePage
...
@@ -14,9 +14,8 @@ class LoginPage extends BasePage
*/
*/
public
function
login
(
$username
,
$password
)
public
function
login
(
$username
,
$password
)
{
{
$this
->
guy
->
submitForm
(
'#login-form'
,
[
$this
->
guy
->
fillField
(
'input[name="LoginForm[username]"]'
,
$username
);
'LoginForm[username]'
=>
$username
,
$this
->
guy
->
fillField
(
'input[name="LoginForm[password]"]'
,
$password
);
'LoginForm[password]'
=>
$password
,
$this
->
guy
->
click
(
'Login'
,
'#login-form'
);
]);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment