File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,27 @@ to serverless.yml
144144 functions:
145145 app:
146146- handler: public/index.php
147- + handler: public/index.php:App\Service\MyHandler
147+ + handler: public/index.php:App\Lambda\MyLambda
148+ ```
149+
150+ #### Invoke handlers locally
151+
152+ Using a service from the container makes the handlers very simple to unit test.
153+ However, if you are lazy, you may want to invoke them locally from CLI.
154+
155+ Run the following command to invoke the ` App\Lambda\MyLambda ` service.
156+
157+ ``` cli
158+ ./vendor/bin/bref-local-handler.php ./bin/container.php:App\\Lambda\\MyLambda
159+ ```
160+
161+ If your service expects some event data, add it as a JSON string or a path to a
162+ file containing JSON.
163+
164+ ``` cli
165+ ./vendor/bin/bref-local-handler.php ./bin/container.php:App\\Lambda\\MyLambda '{"foo":"bar"}'
166+
167+ ./vendor/bin/bref-local-handler.php ./bin/container.php:App\\Lambda\\MyLambda example/input.json
148168```
149169
150170### Console application
You can’t perform that action at this time.
0 commit comments