Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
anis
anis-server
Commits
de55f291
Commit
de55f291
authored
Jun 24, 2019
by
François Agneray
Browse files
Fixed bug tests sur output category
parent
1a7bfc4f
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/Action/Meta/OutputCategoryActionTest.php
View file @
de55f291
...
...
@@ -51,7 +51,8 @@ final class OutputCategoryActionTest extends AbstractActionTestCase
$this
->
assertSame
((
string
)
$response
->
getBody
(),
json_encode
(
array
(
'id'
=>
1
,
'label'
=>
'Default category'
,
'display'
=>
10
'display'
=>
10
,
'id_output_family'
=>
1
)));
}
...
...
@@ -66,7 +67,6 @@ final class OutputCategoryActionTest extends AbstractActionTestCase
$request
=
$this
->
getRequestForPut
(
$editedCategory
);
$response
=
(
$this
->
action
)(
$request
,
new
\
Slim\Http\Response
(),
array
(
'id'
=>
1
));
$this
->
assertEquals
(
200
,
(
int
)
$response
->
getStatusCode
());
unset
(
$editedCategory
[
'id_output_family'
]);
$this
->
assertSame
((
string
)
$response
->
getBody
(),
json_encode
(
$editedCategory
));
$this
->
assertSame
(
2
,
$this
->
getDatabaseTester
()
->
getConnection
()
->
getRowCount
(
'output_category'
));
}
...
...
tests/Action/Meta/OutputCategoryListActionTest.php
View file @
de55f291
...
...
@@ -37,12 +37,14 @@ final class OutputCategoryListActionTest extends AbstractActionTestCase
array
(
'id'
=>
1
,
'label'
=>
'Default category'
,
'display'
=>
10
'display'
=>
10
,
'id_output_family'
=>
1
),
array
(
'id'
=>
2
,
'label'
=>
'Photometry'
,
'display'
=>
20
'display'
=>
20
,
'id_output_family'
=>
1
)
)));
}
...
...
@@ -58,7 +60,6 @@ final class OutputCategoryListActionTest extends AbstractActionTestCase
$request
=
$this
->
getRequestForPost
(
$newCategory
);
$response
=
(
$this
->
action
)(
$request
,
new
\
Slim\Http\Response
(),
array
());
$this
->
assertEquals
(
201
,
(
int
)
$response
->
getStatusCode
());
unset
(
$newCategory
[
'id_output_family'
]);
$this
->
assertSame
((
string
)
$response
->
getBody
(),
json_encode
(
array_merge
(
array
(
'id'
=>
3
),
$newCategory
)));
$this
->
assertSame
(
3
,
$this
->
getDatabaseTester
()
->
getConnection
()
->
getRowCount
(
'output_category'
));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment