@@ -37,7 +37,7 @@ This module allows you to run functional tests for Lumen.
37
37
Please try it and leave your feedback.
38
38
39
39
### Demo project
40
- < https://github.com/Codeception/ codeception- lumen-sample >
40
+ < https://github.com/codeception/ lumen-module-tests >
41
41
42
42
43
43
### Config
@@ -56,13 +56,18 @@ Please try it and leave your feedback.
56
56
57
57
### Parts
58
58
59
- * ORM - only include the database methods of this module:
59
+ * ` ORM ` : Only include the database methods of this module:
60
+ * dontSeeRecord
61
+ * grabRecord
60
62
* have
61
63
* haveMultiple
62
64
* haveRecord
63
- * grabRecord
65
+ * make
66
+ * makeMultiple
64
67
* seeRecord
65
- * dontSeeRecord
68
+
69
+ See [ WebDriver module] ( https://codeception.com/docs/modules/WebDriver#Loading-Parts-from-other-Modules )
70
+ for general information on how to load parts of a framework module.
66
71
67
72
### Actions
68
73
@@ -206,9 +211,8 @@ Authenticates user for HTTP_AUTH
206
211
Set the authenticated user for the next request.
207
212
This will not persist between multiple requests.
208
213
209
- * ` param ` \Illuminate\Contracts\Auth\Authenticatable
210
- * ` param ` string|null $driver The authentication driver for Lumen <= 5.1.* , guard name for Lumen >= 5.2
211
- * ` return ` void
214
+ * ` param Authenticatable ` $user
215
+ * ` param string|null ` $guardName The guard name
212
216
213
217
214
218
#### amOnPage
@@ -236,11 +240,10 @@ Opens web page using route name and parameters.
236
240
237
241
<? php
238
242
$I-> amOnRoute('homepage');
239
- ?>
240
243
241
244
{% endhighlight %}
242
245
243
- * ` param ` $routeName
246
+ * `param string ` $routeName
244
247
* `param array` $params
245
248
246
249
@@ -284,7 +287,6 @@ Clear the registered application handlers.
284
287
285
288
<? php
286
289
$I-> clearApplicationHandlers();
287
- ?>
288
290
289
291
{% endhighlight %}
290
292
@@ -615,9 +617,8 @@ You can pass the name of a database table or the class name of an Eloquent model
615
617
{% highlight php %}
616
618
617
619
<? php
618
- $I-> dontSeeRecord('users', array('name' => 'davert'));
619
- $I->dontSeeRecord('App\User', array('name' => 'davert'));
620
- ?>
620
+ $I-> dontSeeRecord('users', ['name' => 'davert']);
621
+ $I->dontSeeRecord('App\Models\User', ['name' => 'davert']);
621
622
622
623
{% endhighlight %}
623
624
@@ -663,8 +664,6 @@ $I->fillField(['name' => 'email'], 'jon@mail.com');
663
664
664
665
Provides access the Lumen application object.
665
666
666
- * ` return ` \Laravel\Lumen\Application
667
-
668
667
669
668
#### grabAttributeFrom
670
669
@@ -761,9 +760,8 @@ You can also pass the class name of an Eloquent model, in that case this method
761
760
{% highlight php %}
762
761
763
762
<? php
764
- $record = $I-> grabRecord('users', array('name' => 'davert')); // returns array
765
- $record = $I->grabRecord('App\User', array('name' => 'davert')); // returns Eloquent model
766
- ?>
763
+ $record = $I-> grabRecord('users', ['name' => 'davert']); // returns array
764
+ $record = $I->grabRecord('App\Models\User', ['name' => 'davert']); // returns Eloquent model
767
765
768
766
{% endhighlight %}
769
767
@@ -791,11 +789,10 @@ App::bind('foo', function($app)
791
789
$service = $I-> grabService('foo');
792
790
793
791
// Will return an instance of FooBar, also works for singletons.
794
- ?>
795
792
796
793
{% endhighlight %}
797
794
798
- * ` param ` string $class
795
+ * `param string` $class
799
796
800
797
801
798
#### grabTextFrom
@@ -828,15 +825,13 @@ $value = $I->grabTextFrom('~<input value=(.*?)]~sgi'); // match with a regex
828
825
#### have
829
826
830
827
Use Lumen's model factory to create a model.
831
- Can only be used with Lumen 5.1 and later.
832
828
833
829
{% highlight php %}
834
830
835
831
<? php
836
- $I-> have('App\User');
837
- $I->have('App\User', ['name' => 'John Doe']);
838
- $I->have('App\User', [], 'admin');
839
- ?>
832
+ $I-> have('App\Models\User');
833
+ $I->have('App\Models\User', ['name' => 'John Doe']);
834
+ $I->have('App\Models\User', [], 'admin');
840
835
841
836
{% endhighlight %}
842
837
@@ -858,7 +853,6 @@ The Laravel application object will be passed as an argument to the handler.
858
853
$I-> haveApplicationHandler(function($app) {
859
854
$app->make('config')->set(['test_value' => '10']);
860
855
});
861
- ?>
862
856
863
857
{% endhighlight %}
864
858
@@ -873,8 +867,7 @@ Add a binding to the Laravel service container.
873
867
{% highlight php %}
874
868
875
869
<? php
876
- $I-> haveBinding('My\Interface', 'My\Implementation');
877
- ?>
870
+ $I-> haveBinding('App\MyInterface', 'App\MyImplementation');
878
871
879
872
{% endhighlight %}
880
873
@@ -890,13 +883,12 @@ Add a contextual binding to the Laravel service container.
890
883
{% highlight php %}
891
884
892
885
<? php
893
- $I-> haveContextualBinding('My\Class ', '$variable', 'value');
886
+ $I-> haveContextualBinding('App\MyClass ', '$variable', 'value');
894
887
895
888
// This is similar to the following in your Laravel application
896
- $app->when('My\Class ')
889
+ $app->when('App\MyClass ')
897
890
->needs('$variable')
898
891
->give('value');
899
- ?>
900
892
901
893
{% endhighlight %}
902
894
@@ -946,8 +938,7 @@ Add an instance binding to the Laravel service container.
946
938
{% highlight php %}
947
939
948
940
<? php
949
- $I-> haveInstance('My\Class', new My\Class());
950
- ?>
941
+ $I-> haveInstance('App\MyClass', new App\MyClass());
951
942
952
943
{% endhighlight %}
953
944
@@ -957,16 +948,14 @@ $I->haveInstance('My\Class', new My\Class());
957
948
958
949
#### haveMultiple
959
950
960
- Use Laravel's model factory to create multiple models.
961
- Can only be used with Lumen 5.1 and later.
951
+ Use Laravel model factory to create multiple models.
962
952
963
953
{% highlight php %}
964
954
965
955
<? php
966
- $I-> haveMultiple('App\User', 10);
967
- $I->haveMultiple('App\User', 10, ['name' => 'John Doe']);
968
- $I->haveMultiple('App\User', 10, [], 'admin');
969
- ?>
956
+ $I-> haveMultiple('App\Models\User', 10);
957
+ $I->haveMultiple('App\Models\User', 10, ['name' => 'John Doe']);
958
+ $I->haveMultiple('App\Models\User', 10, [], 'admin');
970
959
971
960
{% endhighlight %}
972
961
@@ -987,9 +976,8 @@ You can also pass the class name of an Eloquent model, in that case this method
987
976
{% highlight php %}
988
977
989
978
<? php
990
- $user_id = $I-> haveRecord('users', array('name' => 'Davert')); // returns integer
991
- $user = $I->haveRecord('App\User', array('name' => 'Davert')); // returns Eloquent model
992
- ?>
979
+ $userId = $I-> haveRecord('users', ['name' => 'Davert']); // returns integer
980
+ $user = $I->haveRecord('App\Models\User', ['name' => 'Davert']); // returns Eloquent model
993
981
994
982
{% endhighlight %}
995
983
@@ -1021,7 +1009,6 @@ Add a singleton binding to the Laravel service container.
1021
1009
1022
1010
<? php
1023
1011
$I-> haveSingleton('My\Interface', 'My\Singleton');
1024
- ?>
1025
1012
1026
1013
{% endhighlight %}
1027
1014
@@ -1032,15 +1019,13 @@ $I->haveSingleton('My\Interface', 'My\Singleton');
1032
1019
#### make
1033
1020
1034
1021
Use Lumen's model factory to make a model instance.
1035
- Can only be used with Lumen 5.1 and later.
1036
1022
1037
1023
{% highlight php %}
1038
1024
1039
1025
<? php
1040
- $I-> make('App\User');
1041
- $I->make('App\User', ['name' => 'John Doe']);
1042
- $I->make('App\User', [], 'admin');
1043
- ?>
1026
+ $I-> make('App\Models\User');
1027
+ $I->make('App\Models\User', ['name' => 'John Doe']);
1028
+ $I->make('App\Models\User', [], 'admin');
1044
1029
1045
1030
{% endhighlight %}
1046
1031
@@ -1070,16 +1055,14 @@ $I->makeHtmlSnapshot();
1070
1055
1071
1056
#### makeMultiple
1072
1057
1073
- Use Laravel's model factory to make multiple model instances.
1074
- Can only be used with Lumen 5.1 and later.
1058
+ Use Laravel model factory to make multiple model instances.
1075
1059
1076
1060
{% highlight php %}
1077
1061
1078
1062
<? php
1079
- $I-> makeMultiple('App\User', 10);
1080
- $I->makeMultiple('App\User', 10, ['name' => 'John Doe']);
1081
- $I->makeMultiple('App\User', 10, [], 'admin');
1082
- ?>
1063
+ $I-> makeMultiple('App\Models\User', 10);
1064
+ $I->makeMultiple('App\Models\User', 10, ['name' => 'John Doe']);
1065
+ $I->makeMultiple('App\Models\User', 10, [], 'admin');
1083
1066
1084
1067
{% endhighlight %}
1085
1068
@@ -1445,8 +1428,8 @@ You can pass the name of a database table or the class name of an Eloquent model
1445
1428
{% highlight php %}
1446
1429
1447
1430
<? php
1448
- $I-> seeRecord('users', array( 'name' => 'davert') );
1449
- $I->seeRecord('App\User', array( 'name' => 'davert') );
1431
+ $I-> seeRecord('users', [ 'name' => 'Davert'] );
1432
+ $I->seeRecord('App\Models\ User', [ 'name' => 'Davert'] );
1450
1433
?>
1451
1434
1452
1435
{% endhighlight %}
@@ -1596,8 +1579,7 @@ $I->sendAjaxRequest('PUT', '/posts/7', ['title' => 'new title']);
1596
1579
1597
1580
1598
1581
#### setApplication
1599
-
1600
- * `param \Laravel\Lumen\Application` $app
1582
+ __not documented__
1601
1583
1602
1584
1603
1585
#### setCookie
0 commit comments