Skip to content

Commit 8e84c14

Browse files
committed
fix tests
1 parent 0d1f197 commit 8e84c14

File tree

5 files changed

+173
-182
lines changed

5 files changed

+173
-182
lines changed

src/Service/Agent/Serializer/JsonResultSerializer.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,6 @@ private function removeNoice(string $content): string
6262
$firstPos = strpos($content, '{');
6363
$lastPos = strrpos($content, '}');
6464

65-
$squareBracketFirstPos = strpos($content, '[');
66-
$squareBracketLastPos = strrpos($content, ']');
67-
if ($squareBracketFirstPos < $firstPos) {
68-
$firstPos = $squareBracketFirstPos;
69-
$lastPos = $squareBracketLastPos;
70-
}
71-
7265
if ($firstPos !== false && $lastPos !== false) {
7366
$content = substr($content, $firstPos, $lastPos - $firstPos + 1);
7467
}

tests/Backend/Api/Agent/CollectionTest.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public function testGet()
5555
"type": 2,
5656
"name": "Fusio-Action",
5757
"description": "Helps to develop custom action business logic",
58-
"outgoing": "",
5958
"insertDate": "[datetime]"
6059
},
6160
{
@@ -64,7 +63,7 @@ public function testGet()
6463
"type": 1,
6564
"name": "Fusio-Architect",
6665
"description": "Helps to build complete operations, it uses internally the action, schema and database agent",
67-
"outgoing": "",
66+
"outgoing": "php+class:\/\/Fusio.Agent.Blueprint",
6867
"insertDate": "[datetime]"
6968
},
7069
{
@@ -73,7 +72,7 @@ public function testGet()
7372
"type": 4,
7473
"name": "Fusio-Database",
7574
"description": "Helps to design database table schemas",
76-
"outgoing": "",
75+
"outgoing": "php+class:\/\/Fusio.Agent.Database",
7776
"insertDate": "[datetime]"
7877
},
7978
{
@@ -82,7 +81,6 @@ public function testGet()
8281
"type": 0,
8382
"name": "Fusio-General",
8483
"description": "Helps to answer general questions about your Fusio instance",
85-
"outgoing": "",
8684
"insertDate": "[datetime]"
8785
},
8886
{
@@ -91,7 +89,7 @@ public function testGet()
9189
"type": 3,
9290
"name": "Fusio-Schema",
9391
"description": "Helps to build new schemas to describe JSON payloads",
94-
"outgoing": "",
92+
"outgoing": "php+class:\/\/Fusio.Agent.Schema",
9593
"insertDate": "[datetime]"
9694
},
9795
{
@@ -166,7 +164,6 @@ public function testGetCount()
166164
"type": 2,
167165
"name": "Fusio-Action",
168166
"description": "Helps to develop custom action business logic",
169-
"outgoing": "",
170167
"insertDate": "[datetime]"
171168
},
172169
{
@@ -175,7 +172,7 @@ public function testGetCount()
175172
"type": 1,
176173
"name": "Fusio-Architect",
177174
"description": "Helps to build complete operations, it uses internally the action, schema and database agent",
178-
"outgoing": "",
175+
"outgoing": "php+class:\/\/Fusio.Agent.Blueprint",
179176
"insertDate": "[datetime]"
180177
},
181178
{
@@ -184,7 +181,7 @@ public function testGetCount()
184181
"type": 4,
185182
"name": "Fusio-Database",
186183
"description": "Helps to design database table schemas",
187-
"outgoing": "",
184+
"outgoing": "php+class:\/\/Fusio.Agent.Database",
188185
"insertDate": "[datetime]"
189186
},
190187
{
@@ -193,7 +190,6 @@ public function testGetCount()
193190
"type": 0,
194191
"name": "Fusio-General",
195192
"description": "Helps to answer general questions about your Fusio instance",
196-
"outgoing": "",
197193
"insertDate": "[datetime]"
198194
},
199195
{
@@ -202,7 +198,7 @@ public function testGetCount()
202198
"type": 3,
203199
"name": "Fusio-Schema",
204200
"description": "Helps to build new schemas to describe JSON payloads",
205-
"outgoing": "",
201+
"outgoing": "php+class:\/\/Fusio.Agent.Schema",
206202
"insertDate": "[datetime]"
207203
},
208204
{

tests/Backend/Api/Agent/Message/CollectionTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function testPost()
116116
'User-Agent' => 'Fusio TestCase',
117117
'Authorization' => 'Bearer da250526d583edabca8ac2f99e37ee39aa02a3c076c0edc6929095e20ca18dcf'
118118
), json_encode([
119-
'input' => [
119+
'item' => [
120120
'type' => 'text',
121121
'content' => 'What is the meaning of life?',
122122
],
@@ -129,8 +129,8 @@ public function testPost()
129129

130130
$this->assertEquals(201, $response->getStatusCode(), $body);
131131
$this->assertNotEmpty($chatId);
132-
$this->assertEquals('text', $data->output->type);
133-
$this->assertEquals('The answer ist: 42', $data->output->content);
132+
$this->assertEquals('text', $data->item->type);
133+
$this->assertEquals('The answer ist: 42', $data->item->content);
134134

135135
// check database
136136
$sql = $this->connection->createQueryBuilder()

tests/Backend/Api/Connection/Agent/CollectionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testPost()
4949
'User-Agent' => 'Fusio TestCase',
5050
'Authorization' => 'Bearer da250526d583edabca8ac2f99e37ee39aa02a3c076c0edc6929095e20ca18dcf'
5151
), json_encode([
52-
'input' => [
52+
'item' => [
5353
'type' => 'text',
5454
'content' => 'What is the meaning of life?',
5555
]
@@ -59,7 +59,7 @@ public function testPost()
5959

6060
$expect = <<<JSON
6161
{
62-
"output": {
62+
"item": {
6363
"type": "text",
6464
"content": "The answer ist: 42"
6565
}

0 commit comments

Comments
 (0)