| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
The steps of test Support array result for sequence action in php
[root@nccddev130026 workspace]# cat ~/split.php
<?php
function main(array $args) : array
{
$payload = $args["payload"] ?? "aaaa\nbbbbb\ncccccc";
$separator = $args["separator"] ?? "\n";
$result = explode($separator,$payload);
return $result;
}
[root@nccddev130026 workspace]# cat ~/sort.php
<?php
function main(array $args) : array
{
$result = array_reverse($args);
return $result;
}
wsk -i action create /whisk.system/utils/split-php --kind php:7.4 ~/split.php wsk -i action create /whisk.system/utils/sort-php --kind php:7.4 ~/sort.php wsk -i action create mySequence-php --sequence /whisk.system/utils/split-php,/whisk.system/utils/sort-php wsk -i action invoke --result mySequence-php --param payload "dddd\nbbbb\ncccc\nfffffff\nggggggggg" -r -v |
Sorry, something went wrong.
|
|
||
| val (runCode, runRes) = c.run(runPayload(JsObject())) | ||
| runCode should be(200) | ||
| runRes shouldBe Some(JsObject("0" -> JsString("a"), "1" -> JsString("b"))) |
There was a problem hiding this comment.
It seems php is special, it will return JsObject with index(0, 1, 2....N+1) when php codes return array.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Depend on below prs:
Support array result for common action and sequence action openwhisk#5290 (already merged)
Support array result include sequence action openwhisk-runtime-go#170 (already merged)
Support array result