Log message #4189907

# At Username Text
# Jun 18th 2019, 09:59 conehead Wanna do an Integratration-Test ` use IntegrationTestTrait;` ``` public function testShowIndex() { $this->get('/documents'); $this->assertResponseOk(); } ```
# Jun 18th 2019, 09:54 challgren Depends how your testing
# Jun 18th 2019, 09:42 conehead Or even better, just the method that is called in it
# Jun 18th 2019, 09:41 conehead Need to disable `isAuthorized` somehow for testing
# Jun 18th 2019, 09:37 conehead Hm is there an easy way to mock a whole component?
# Jun 18th 2019, 09:37 challgren I havent messed with that setting in php.ini and from the looks of it. My entire cluster its -1
# Jun 18th 2019, 09:36 martin but by default on a linux server it is -1
# Jun 18th 2019, 09:36 martin lets move it also to -1 :P
# Jun 18th 2019, 09:36 challgren theres your problem
# Jun 18th 2019, 09:35 martin and on my local pc it is 100
# Jun 18th 2019, 09:35 slackebot1 <challgren>
# Jun 18th 2019, 09:35 martin php -i | grep serialize_precision serialize_precision => -1 => -1
# Jun 18th 2019, 09:35 slackebot1 <challgren>
# Jun 18th 2019, 09:34 martin lets check what server has :P
# Jun 18th 2019, 09:34 challgren Yeah my ini has -1
# Jun 18th 2019, 09:33 martin ini_set(‘serialize_precision’, -1); does fix it, but it is strange to do? :P
# Jun 18th 2019, 09:32 neon1024 No idea then, sorry. Good luck with it :slightly_smiling_face:
# Jun 18th 2019, 09:32 neon1024 > A formatted version of number.
# Jun 18th 2019, 09:32 neon1024 Ah I’ve misread this bit
# Jun 18th 2019, 09:32 martin `number_format ( float $number [, int $decimals = 0 ] ) : string`
# Jun 18th 2019, 09:31 neon1024 number_format doesn’t return a string :thinking_face:
# Jun 18th 2019, 09:30 martin I don’t like parsing te float as a string and then calculating with it?
# Jun 18th 2019, 09:29 martin returns long float
# Jun 18th 2019, 09:29 martin $test = 3.95; echo json_encode($test);exit;
# Jun 18th 2019, 09:28 neon1024 @martin Have you trierd using `number_format()` in an entity accessor method?
# Jun 18th 2019, 09:26 martin when I do echo json_decode($array) I get the long float
# Jun 18th 2019, 09:26 conehead What does the debugger say?
# Jun 18th 2019, 09:25 conehead So pr the array you get 3.95 and when returning the result you get an incorrect value?
# Jun 18th 2019, 09:23 martin when I pr the array I just get a nice 3.95 :P
# Jun 18th 2019, 09:22 conehead Martin, can you store it as int (multiplied by 100) and divide by 100 in the last step?
# Jun 18th 2019, 09:21 challgren He is the plugin king!
# Jun 18th 2019, 09:20 martin hmm rounding it in entity does not work, I still get a long float :S
# Jun 18th 2019, 09:19 challgren I’m surprised dereuromark hasn’t come up with a plugin for both yet :P
# Jun 18th 2019, 09:18 challgren I haven’t fully vested into it yet but its been the best one for my use case. Ive been stuck in Kotlin for the past month so havent had time to implement it yet
# Jun 18th 2019, 09:17 conehead @challgren do you save associated data as well? might switch to the audit logging you mentioned
# Jun 18th 2019, 09:15 conehead Well that plugin only stores the changed fields and does not store the whole entity
# Jun 18th 2019, 09:12 neon1024 I need to do both actually, but I’m going to tackle the logging first as it’s a bit simpler
# Jun 18th 2019, 09:11 challgren My use requires rollbacks so thats why I went version than audit log
# Jun 18th 2019, 09:10 challgren Ahh ok
# Jun 18th 2019, 09:10 neon1024 @challgren They would have an overlap in a venn diagram, but logging keeps a log of what has happened, and versioning would store the whole thing
# Jun 18th 2019, 09:08 Martin` But what is a good way to handle the long float? rounding in entity to 2 decimals?