Skip to content

Commit 17b0560

Browse files
committed
fix tests
1 parent 8e84c14 commit 17b0560

File tree

2 files changed

+54
-54
lines changed

2 files changed

+54
-54
lines changed

src/Backend/View/Agent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public function getCollection(QueryFilter $filter, ContextInterface $context)
4040
{
4141
$startIndex = $filter->getStartIndex();
4242
$count = $filter->getCount();
43-
$sortBy = Table\Generated\AgentColumn::tryFrom($filter->getSortBy(Table\Generated\AgentTable::COLUMN_NAME) ?? '');
44-
$sortOrder = $filter->getSortOrder(OrderBy::ASC);
43+
$sortBy = Table\Generated\AgentColumn::tryFrom($filter->getSortBy(Table\Generated\AgentTable::COLUMN_ID) ?? '');
44+
$sortOrder = $filter->getSortOrder(OrderBy::DESC);
4545

4646
$condition = $filter->getCondition($this->getTable(Table\Agent::class), [QueryFilter::COLUMN_SEARCH => Table\Generated\AgentColumn::NAME]);
4747
$condition->equals(Table\Generated\AgentTable::COLUMN_TENANT_ID, $context->getTenantId());

tests/Backend/Api/Agent/CollectionTest.php

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,13 @@ public function testGet()
5050
"itemsPerPage": 16,
5151
"entry": [
5252
{
53-
"id": 3,
54-
"status": 1,
55-
"type": 2,
56-
"name": "Fusio-Action",
57-
"description": "Helps to develop custom action business logic",
58-
"insertDate": "[datetime]"
59-
},
60-
{
61-
"id": 2,
53+
"id": 6,
6254
"status": 1,
63-
"type": 1,
64-
"name": "Fusio-Architect",
65-
"description": "Helps to build complete operations, it uses internally the action, schema and database agent",
66-
"outgoing": "php+class:\/\/Fusio.Agent.Blueprint",
55+
"connection": 8,
56+
"type": 0,
57+
"name": "agent-test",
58+
"description": "An agent test",
59+
"outgoing": "schema:\/\/Entry-Schema",
6760
"insertDate": "[datetime]"
6861
},
6962
{
@@ -75,14 +68,6 @@ public function testGet()
7568
"outgoing": "php+class:\/\/Fusio.Agent.Database",
7669
"insertDate": "[datetime]"
7770
},
78-
{
79-
"id": 1,
80-
"status": 1,
81-
"type": 0,
82-
"name": "Fusio-General",
83-
"description": "Helps to answer general questions about your Fusio instance",
84-
"insertDate": "[datetime]"
85-
},
8671
{
8772
"id": 4,
8873
"status": 1,
@@ -93,13 +78,28 @@ public function testGet()
9378
"insertDate": "[datetime]"
9479
},
9580
{
96-
"id": 6,
81+
"id": 3,
82+
"status": 1,
83+
"type": 2,
84+
"name": "Fusio-Action",
85+
"description": "Helps to develop custom action business logic",
86+
"insertDate": "[datetime]"
87+
},
88+
{
89+
"id": 2,
90+
"status": 1,
91+
"type": 1,
92+
"name": "Fusio-Architect",
93+
"description": "Helps to build complete operations, it uses internally the action, schema and database agent",
94+
"outgoing": "php+class:\/\/Fusio.Agent.Blueprint",
95+
"insertDate": "[datetime]"
96+
},
97+
{
98+
"id": 1,
9799
"status": 1,
98-
"connection": 8,
99100
"type": 0,
100-
"name": "agent-test",
101-
"description": "An agent test",
102-
"outgoing": "schema:\/\/Entry-Schema",
101+
"name": "Fusio-General",
102+
"description": "Helps to answer general questions about your Fusio instance",
103103
"insertDate": "[datetime]"
104104
}
105105
]
@@ -159,20 +159,13 @@ public function testGetCount()
159159
"itemsPerPage": 80,
160160
"entry": [
161161
{
162-
"id": 3,
163-
"status": 1,
164-
"type": 2,
165-
"name": "Fusio-Action",
166-
"description": "Helps to develop custom action business logic",
167-
"insertDate": "[datetime]"
168-
},
169-
{
170-
"id": 2,
162+
"id": 6,
171163
"status": 1,
172-
"type": 1,
173-
"name": "Fusio-Architect",
174-
"description": "Helps to build complete operations, it uses internally the action, schema and database agent",
175-
"outgoing": "php+class:\/\/Fusio.Agent.Blueprint",
164+
"connection": 8,
165+
"type": 0,
166+
"name": "agent-test",
167+
"description": "An agent test",
168+
"outgoing": "schema:\/\/Entry-Schema",
176169
"insertDate": "[datetime]"
177170
},
178171
{
@@ -184,14 +177,6 @@ public function testGetCount()
184177
"outgoing": "php+class:\/\/Fusio.Agent.Database",
185178
"insertDate": "[datetime]"
186179
},
187-
{
188-
"id": 1,
189-
"status": 1,
190-
"type": 0,
191-
"name": "Fusio-General",
192-
"description": "Helps to answer general questions about your Fusio instance",
193-
"insertDate": "[datetime]"
194-
},
195180
{
196181
"id": 4,
197182
"status": 1,
@@ -202,13 +187,28 @@ public function testGetCount()
202187
"insertDate": "[datetime]"
203188
},
204189
{
205-
"id": 6,
190+
"id": 3,
191+
"status": 1,
192+
"type": 2,
193+
"name": "Fusio-Action",
194+
"description": "Helps to develop custom action business logic",
195+
"insertDate": "[datetime]"
196+
},
197+
{
198+
"id": 2,
199+
"status": 1,
200+
"type": 1,
201+
"name": "Fusio-Architect",
202+
"description": "Helps to build complete operations, it uses internally the action, schema and database agent",
203+
"outgoing": "php+class:\/\/Fusio.Agent.Blueprint",
204+
"insertDate": "[datetime]"
205+
},
206+
{
207+
"id": 1,
206208
"status": 1,
207-
"connection": 8,
208209
"type": 0,
209-
"name": "agent-test",
210-
"description": "An agent test",
211-
"outgoing": "schema:\/\/Entry-Schema",
210+
"name": "Fusio-General",
211+
"description": "Helps to answer general questions about your Fusio instance",
212212
"insertDate": "[datetime]"
213213
}
214214
]

0 commit comments

Comments
 (0)