Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
e1b672c0
Verified
Commit
e1b672c0
authored
5 years ago
by
Florian Azizian
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #11275 TIME 0:20 fix entities TU
parent
939a7483
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
migration/19.12/1912.sql
+2
-4
2 additions, 4 deletions
migration/19.12/1912.sql
test/unitTests/app/entity/EntityControllerTest.php
+8
-5
8 additions, 5 deletions
test/unitTests/app/entity/EntityControllerTest.php
with
10 additions
and
9 deletions
migration/19.12/1912.sql
+
2
−
4
View file @
e1b672c0
...
@@ -17,6 +17,8 @@ DROP VIEW IF EXISTS view_folders;
...
@@ -17,6 +17,8 @@ DROP VIEW IF EXISTS view_folders;
ALTER
TABLE
users
DROP
COLUMN
IF
EXISTS
reset_token
;
ALTER
TABLE
users
DROP
COLUMN
IF
EXISTS
reset_token
;
ALTER
TABLE
users
DROP
COLUMN
IF
EXISTS
change_password
;
ALTER
TABLE
users
DROP
COLUMN
IF
EXISTS
change_password
;
ALTER
TABLE
users
ADD
COLUMN
reset_token
text
;
ALTER
TABLE
users
ADD
COLUMN
reset_token
text
;
ALTER
TABLE
users
DROP
COLUMN
IF
EXISTS
preferences
;
ALTER
TABLE
users
ADD
COLUMN
preferences
jsonb
NOT
NULL
DEFAULT
'{"documentEdition" : "java"}'
;
/* FULL TEXT */
/* FULL TEXT */
DELETE
FROM
docservers
where
docserver_type_id
=
'FULLTEXT'
;
DELETE
FROM
docservers
where
docserver_type_id
=
'FULLTEXT'
;
...
@@ -431,10 +433,6 @@ CREATE TABLE contacts_parameters
...
@@ -431,10 +433,6 @@ CREATE TABLE contacts_parameters
)
)
WITH
(
OIDS
=
FALSE
);
WITH
(
OIDS
=
FALSE
);
/* USERS */
ALTER
TABLE
users
DROP
COLUMN
IF
EXISTS
preferences
;
ALTER
TABLE
users
ADD
COLUMN
preferences
jsonb
NOT
NULL
DEFAULT
'{"documentEdition" : "java"}'
;
ALTER
TABLE
acknowledgement_receipts
DROP
COLUMN
IF
EXISTS
contact_id
;
ALTER
TABLE
acknowledgement_receipts
DROP
COLUMN
IF
EXISTS
contact_id
;
ALTER
TABLE
acknowledgement_receipts
ADD
COLUMN
contact_id
integer
;
ALTER
TABLE
acknowledgement_receipts
ADD
COLUMN
contact_id
integer
;
ALTER
TABLE
contacts_groups_lists
DROP
COLUMN
IF
EXISTS
contact_id
;
ALTER
TABLE
contacts_groups_lists
DROP
COLUMN
IF
EXISTS
contact_id
;
...
...
This diff is collapsed.
Click to expand it.
test/unitTests/app/entity/EntityControllerTest.php
+
8
−
5
View file @
e1b672c0
...
@@ -38,10 +38,13 @@ class EntityControllerTest extends TestCase
...
@@ -38,10 +38,13 @@ class EntityControllerTest extends TestCase
$this
->
assertInternalType
(
'array'
,
$responseBody
->
entities
);
$this
->
assertInternalType
(
'array'
,
$responseBody
->
entities
);
$entityInfo
=
\Entity\models\EntityModel
::
getByEntityId
([
'entityId'
=>
'TEST-ENTITY123'
,
'select'
=>
[
'id'
]]);
self
::
$id
=
$entityInfo
[
'id'
];
// READ
// READ
$environment
=
\Slim\Http\Environment
::
mock
([
'REQUEST_METHOD'
=>
'GET'
]);
$environment
=
\Slim\Http\Environment
::
mock
([
'REQUEST_METHOD'
=>
'GET'
]);
$request
=
\Slim\Http\Request
::
createFromEnvironment
(
$environment
);
$request
=
\Slim\Http\Request
::
createFromEnvironment
(
$environment
);
$response
=
$entityController
->
getById
(
$request
,
new
\Slim\Http\Response
(),
[
'id'
=>
'TEST-ENTITY123'
]);
$response
=
$entityController
->
getById
(
$request
,
new
\Slim\Http\Response
(),
[
'id'
=>
self
::
$id
]);
$responseBody
=
json_decode
((
string
)
$response
->
getBody
());
$responseBody
=
json_decode
((
string
)
$response
->
getBody
());
$this
->
assertSame
(
'TEST-ENTITY123'
,
$responseBody
->
entity_id
);
$this
->
assertSame
(
'TEST-ENTITY123'
,
$responseBody
->
entity_id
);
...
@@ -76,7 +79,7 @@ class EntityControllerTest extends TestCase
...
@@ -76,7 +79,7 @@ class EntityControllerTest extends TestCase
// READ
// READ
$environment
=
\Slim\Http\Environment
::
mock
([
'REQUEST_METHOD'
=>
'GET'
]);
$environment
=
\Slim\Http\Environment
::
mock
([
'REQUEST_METHOD'
=>
'GET'
]);
$request
=
\Slim\Http\Request
::
createFromEnvironment
(
$environment
);
$request
=
\Slim\Http\Request
::
createFromEnvironment
(
$environment
);
$response
=
$entityController
->
getById
(
$request
,
new
\Slim\Http\Response
(),
[
'id'
=>
'TEST-ENTITY123'
]);
$response
=
$entityController
->
getById
(
$request
,
new
\Slim\Http\Response
(),
[
'id'
=>
self
::
$id
]);
$responseBody
=
json_decode
((
string
)
$response
->
getBody
());
$responseBody
=
json_decode
((
string
)
$response
->
getBody
());
$this
->
assertSame
(
'TEST-ENTITY123'
,
$responseBody
->
entity_id
);
$this
->
assertSame
(
'TEST-ENTITY123'
,
$responseBody
->
entity_id
);
...
@@ -107,7 +110,7 @@ class EntityControllerTest extends TestCase
...
@@ -107,7 +110,7 @@ class EntityControllerTest extends TestCase
// READ
// READ
$environment
=
\Slim\Http\Environment
::
mock
([
'REQUEST_METHOD'
=>
'GET'
]);
$environment
=
\Slim\Http\Environment
::
mock
([
'REQUEST_METHOD'
=>
'GET'
]);
$request
=
\Slim\Http\Request
::
createFromEnvironment
(
$environment
);
$request
=
\Slim\Http\Request
::
createFromEnvironment
(
$environment
);
$response
=
$entityController
->
getById
(
$request
,
new
\Slim\Http\Response
(),
[
'id'
=>
'TEST-ENTITY123'
]);
$response
=
$entityController
->
getById
(
$request
,
new
\Slim\Http\Response
(),
[
'id'
=>
self
::
$id
]);
$responseBody
=
json_decode
((
string
)
$response
->
getBody
());
$responseBody
=
json_decode
((
string
)
$response
->
getBody
());
$this
->
assertSame
(
'TEST-ENTITY123'
,
$responseBody
->
entity_id
);
$this
->
assertSame
(
'TEST-ENTITY123'
,
$responseBody
->
entity_id
);
...
@@ -129,7 +132,7 @@ class EntityControllerTest extends TestCase
...
@@ -129,7 +132,7 @@ class EntityControllerTest extends TestCase
// READ
// READ
$environment
=
\Slim\Http\Environment
::
mock
([
'REQUEST_METHOD'
=>
'GET'
]);
$environment
=
\Slim\Http\Environment
::
mock
([
'REQUEST_METHOD'
=>
'GET'
]);
$request
=
\Slim\Http\Request
::
createFromEnvironment
(
$environment
);
$request
=
\Slim\Http\Request
::
createFromEnvironment
(
$environment
);
$response
=
$entityController
->
getById
(
$request
,
new
\Slim\Http\Response
(),
[
'id'
=>
'TEST-ENTITY123'
]);
$response
=
$entityController
->
getById
(
$request
,
new
\Slim\Http\Response
(),
[
'id'
=>
self
::
$id
]);
$responseBody
=
json_decode
((
string
)
$response
->
getBody
());
$responseBody
=
json_decode
((
string
)
$response
->
getBody
());
$this
->
assertSame
(
'TEST-ENTITY123'
,
$responseBody
->
entity_id
);
$this
->
assertSame
(
'TEST-ENTITY123'
,
$responseBody
->
entity_id
);
...
@@ -197,7 +200,7 @@ class EntityControllerTest extends TestCase
...
@@ -197,7 +200,7 @@ class EntityControllerTest extends TestCase
// READ
// READ
$environment
=
\Slim\Http\Environment
::
mock
([
'REQUEST_METHOD'
=>
'GET'
]);
$environment
=
\Slim\Http\Environment
::
mock
([
'REQUEST_METHOD'
=>
'GET'
]);
$request
=
\Slim\Http\Request
::
createFromEnvironment
(
$environment
);
$request
=
\Slim\Http\Request
::
createFromEnvironment
(
$environment
);
$response
=
$entityController
->
getById
(
$request
,
new
\Slim\Http\Response
(),
[
'id'
=>
'TEST-ENTITY123'
]);
$response
=
$entityController
->
getById
(
$request
,
new
\Slim\Http\Response
(),
[
'id'
=>
self
::
$id
]);
$responseBody
=
json_decode
((
string
)
$response
->
getBody
());
$responseBody
=
json_decode
((
string
)
$response
->
getBody
());
$this
->
assertSame
(
'Entity not found'
,
$responseBody
->
errors
);
$this
->
assertSame
(
'Entity not found'
,
$responseBody
->
errors
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment