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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
19fa5cb3
Commit
19fa5cb3
authored
Feb 06, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2353 from Ragazzo/tests_improved
tests improved
parents
beafb99e
9e770acd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
ContactPage.php
apps/basic/tests/_pages/ContactPage.php
+4
-4
LoginPage.php
apps/basic/tests/_pages/LoginPage.php
+3
-4
No files found.
apps/basic/tests/_pages/ContactPage.php
View file @
19fa5cb3
...
...
@@ -13,10 +13,10 @@ class ContactPage extends BasePage
*/
public
function
submit
(
array
$contactData
)
{
$data
=
[];
foreach
(
$contactData
as
$name
=>
$value
)
{
$
data
[
"ContactForm[
$name
]"
]
=
$value
;
foreach
(
$contactData
as
$field
=>
$value
)
{
$inputType
=
(
$field
==
'body'
)
?
'textarea'
:
'input'
;
$
this
->
guy
->
fillField
(
$inputType
.
'[name="ContactForm['
.
$field
.
']"]'
,
$value
)
;
}
$this
->
guy
->
submitForm
(
'#contact-form'
,
$data
);
$this
->
guy
->
click
(
'Submit'
,
'#contact-form'
);
}
}
apps/basic/tests/_pages/LoginPage.php
View file @
19fa5cb3
...
...
@@ -14,9 +14,8 @@ class LoginPage extends BasePage
*/
public
function
login
(
$username
,
$password
)
{
$this
->
guy
->
submitForm
(
'#login-form'
,
[
'LoginForm[username]'
=>
$username
,
'LoginForm[password]'
=>
$password
,
]);
$this
->
guy
->
fillField
(
'input[name="LoginForm[username]"]'
,
$username
);
$this
->
guy
->
fillField
(
'input[name="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