Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0f664cd

Browse files
Added tests for route() helper
1 parent abdb792 commit 0f664cd

File tree

6 files changed

+446
-45
lines changed

6 files changed

+446
-45
lines changed

‎config/app.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
|
2727
*/
2828

29-
'url' => 'http://localhost',
29+
'url' => 'http://myapp.com',
3030

3131
/*
3232
|--------------------------------------------------------------------------

‎tests/api/ApiTester.php‎

Lines changed: 76 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php //[STAMP] 208a5aabd8b3cbf311bce9385040e7e4
1+
<?php //[STAMP] 5d8d4bee99eb2e9043c0849267f3483c
22

33
// This class was automatically generated by build task
44
// You should not change it manually as it will be overwritten on next build
@@ -1527,8 +1527,8 @@ public function dontSeeInFormFields($formSelector, $params) {
15271527
/**
15281528
* [!] Method is generated. Documentation taken from corresponding module.
15291529
*
1530-
* Submits the given form on the page, optionally with the given form values.
1531-
* Give the form fields values as an array.
1530+
* Submits the given form on the page, optionally with the given form
1531+
* values. Give the form fields values as an array.
15321532
*
15331533
* Skipped fields will be filled by their values from the page.
15341534
* You don't need to click the 'Submit' button afterwards.
@@ -1543,20 +1543,33 @@ public function dontSeeInFormFields($formSelector, $params) {
15431543
*
15441544
* ``` php
15451545
* <?php
1546-
* $I->submitForm('#login', array('login' => 'davert', 'password' => '123456'));
1546+
* $I->submitForm('#login', [
1547+
* 'login' => 'davert',
1548+
* 'password' => '123456'
1549+
* ]);
15471550
* // or
1548-
* $I->submitForm('#login', array('login' => 'davert', 'password' => '123456'), 'submitButtonName');
1551+
* $I->submitForm('#login', [
1552+
* 'login' => 'davert',
1553+
* 'password' => '123456'
1554+
* ], 'submitButtonName');
15491555
*
15501556
* ```
15511557
*
15521558
* For example, given this sample "Sign Up" form:
15531559
*
15541560
* ``` html
15551561
* <form action="/sign_up">
1556-
* Login: <input type="text" name="user[login]" /><br/>
1557-
* Password: <input type="password" name="user[password]" /><br/>
1558-
* Do you agree to out terms? <input type="checkbox" name="user[agree]" /><br/>
1559-
* Select pricing plan <select name="plan"><option value="1">Free</option><option value="2" selected="selected">Paid</option></select>
1562+
* Login:
1563+
* <input type="text" name="user[login]" /><br/>
1564+
* Password:
1565+
* <input type="password" name="user[password]" /><br/>
1566+
* Do you agree to out terms?
1567+
* <input type="checkbox" name="user[agree]" /><br/>
1568+
* Select pricing plan:
1569+
* <select name="plan">
1570+
* <option value="1">Free</option>
1571+
* <option value="2" selected="selected">Paid</option>
1572+
* </select>
15601573
* <input type="submit" name="submitButton" value="Submit" />
15611574
* </form>
15621575
* ```
@@ -1565,17 +1578,36 @@ public function dontSeeInFormFields($formSelector, $params) {
15651578
*
15661579
* ``` php
15671580
* <?php
1568-
* $I->submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)), 'submitButton');
1569-
*
1581+
* $I->submitForm(
1582+
* '#userForm',
1583+
* [
1584+
* 'user' => [
1585+
* 'login' => 'Davert',
1586+
* 'password' => '123456',
1587+
* 'agree' => true
1588+
* ]
1589+
* ],
1590+
* 'submitButton'
1591+
* );
15701592
* ```
1571-
* Note that "2" will be the submitted value for the "plan" field, as it is the selected option.
1593+
* Note that "2" will be the submitted value for the "plan" field, as it is
1594+
* the selected option.
15721595
*
1573-
* You can also emulate a JavaScript submission by not specifying any buttons in the third parameter to submitForm.
1596+
* You can also emulate a JavaScript submission by not specifying any
1597+
* buttons in the third parameter to submitForm.
15741598
*
15751599
* ```php
15761600
* <?php
1577-
* $I->submitForm('#userForm', array('user' => array('login' => 'Davert', 'password' => '123456', 'agree' => true)));
1578-
*
1601+
* $I->submitForm(
1602+
* '#userForm',
1603+
* [
1604+
* 'user' => [
1605+
* 'login' => 'Davert',
1606+
* 'password' => '123456',
1607+
* 'agree' => true
1608+
* ]
1609+
* ]
1610+
* );
15791611
* ```
15801612
*
15811613
* Pair this with seeInFormFields for quick testing magic.
@@ -1620,8 +1652,31 @@ public function dontSeeInFormFields($formSelector, $params) {
16201652
* ?>
16211653
* ```
16221654
*
1623-
* Mixing string and boolean values for a checkbox's value is not
1624-
* supported and may produce unexpected results.
1655+
* Mixing string and boolean values for a checkbox's value is not supported
1656+
* and may produce unexpected results.
1657+
*
1658+
* Field names ending in "[]" must be passed without the trailing square
1659+
* bracket characters, and must contain an array for its value. This allows
1660+
* submitting multiple values with the same name, consider:
1661+
*
1662+
* ```php
1663+
* $I->submitForm('#my-form', [
1664+
* 'field[]' => 'value',
1665+
* 'field[]' => 'another value', // 'field[]' is already a defined key
1666+
* ]);
1667+
* ```
1668+
*
1669+
* The solution is to pass an array value:
1670+
*
1671+
* ```php
1672+
* // this way both values are submitted
1673+
* $I->submitForm('#my-form', [
1674+
* 'field' => [
1675+
* 'value',
1676+
* 'another value',
1677+
* ]
1678+
* ]);
1679+
* ```
16251680
*
16261681
* @param $selector
16271682
* @param $params
@@ -3254,7 +3309,7 @@ public function assertNotSame($expected, $actual, $message = null) {
32543309
/**
32553310
* [!] Method is generated. Documentation taken from corresponding module.
32563311
*
3257-
* Checks that expected is greater than actual
3312+
* Checks that actual is greater than expected
32583313
*
32593314
* @param $expected
32603315
* @param $actual
@@ -3280,7 +3335,7 @@ public function assertGreaterThen($expected, $actual, $message = null) {
32803335
/**
32813336
* [!] Method is generated. Documentation taken from corresponding module.
32823337
*
3283-
* Checks that expected is greater or equal than actual
3338+
* Checks that actual is greater or equal than expected
32843339
*
32853340
* @param $expected
32863341
* @param $actual
@@ -3306,7 +3361,7 @@ public function assertGreaterThenOrEqual($expected, $actual, $message = null) {
33063361
/**
33073362
* [!] Method is generated. Documentation taken from corresponding module.
33083363
*
3309-
* Checks that expected is less than actual
3364+
* Checks that actual is less than expected
33103365
*
33113366
* @param $expected
33123367
* @param $actual
@@ -3321,7 +3376,7 @@ public function assertLessThan($expected, $actual, $message = null) {
33213376
/**
33223377
* [!] Method is generated. Documentation taken from corresponding module.
33233378
*
3324-
* Checks that expected is less or equal than actual
3379+
* Checks that actual is less or equal than expected
33253380
*
33263381
* @param $expected
33273382
* @param $actual

‎tests/functional.suite.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class_name: FunctionalTester
88
modules:
9-
enabled: [Laravel5, FunctionalHelper]
9+
enabled: [Laravel5, Asserts, FunctionalHelper]
1010
config:
1111
Laravel5:
1212
environment_file: .env.testing

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /