# |
Jul 19th 2019, 04:15 |
justin.denick |
@rightscoreanalysis ids => `[`‘2’,‘1’`]` needs to be an array. |
# |
Jul 18th 2019, 22:55 |
rightscoreanalysis |
my brain is melting... tired. Trying to save a hasMany relationship... is this not the correct format:delivery_types => [ 'ids' => '2,1' ] |
# |
Jul 18th 2019, 21:33 |
grzegorek.rafal |
hello |
# |
Jul 18th 2019, 18:53 |
joey.mukherjee |
Figured it out! I didn't realize Traits were a PHP thing and not a CakePHP thing. I was wondering why the docs were so sparse. Anyway, I made a new controller which included the trait and then did a return $this->profile ($id) at the end. Thanks for the help! |
# |
Jul 18th 2019, 18:18 |
yamcomnet |
@challgren Thanks! |
# |
Jul 18th 2019, 18:17 |
challgren |
@yamcomnet https://sandbox.dereuromark.de/export |
# |
Jul 18th 2019, 18:10 |
yamcomnet |
Need country list phone number prefixes as array. _Just use some random gist list or is there such "official" lists somewhere? |
# |
Jul 18th 2019, 15:03 |
ajibarra |
I am not sure what do you want to do exactly. If you can be more specific |
# |
Jul 18th 2019, 13:54 |
neon1024 |
8) |
# |
Jul 18th 2019, 13:54 |
spriz |
more elegant than what I'd end up doing @neon1024 :clap: |
# |
Jul 18th 2019, 13:54 |
spriz |
Sneaky sneaky |
# |
Jul 18th 2019, 13:54 |
spriz |
Aha |
# |
Jul 18th 2019, 13:48 |
neon1024 |
Not exactly elegant, but probably better than reflection as it’s still using the public api |
# |
Jul 18th 2019, 13:47 |
neon1024 |
Then assert on the array which was built in the callable |
# |
Jul 18th 2019, 13:47 |
slackebot |
<neon1024> |
# |
Jul 18th 2019, 13:47 |
neon1024 |
@spriz I solved it |
# |
Jul 18th 2019, 13:47 |
noel |
I'm a bit confused by friendsofcake/crud... the docs don't show how the RESTful urls would be structured for each type of call? Where is that information? I mean I notice that it generally conforms to the format set out here: https://book.cakephp.org/3.0/en/views/json-and-xml-views.html#enabling-data-views-in-your-application but for example with bulk delete I can't figure out what the corresponding REST url would be? |
# |
Jul 18th 2019, 13:34 |
neon1024 |
Maybe I’ll have to reflect the property :grimacing: |
# |
Jul 18th 2019, 13:28 |
spriz |
Thanks @ndm |
# |
Jul 18th 2019, 13:28 |
spriz |
I see I've done that elsewhere as well |
# |
Jul 18th 2019, 13:28 |
spriz |
Do'h! `new Stream` ofc... |
# |
Jul 18th 2019, 13:17 |
ndm |
@spriz You either live with converting the stream to a string (eg via `stream_get_contents()`), or you wrap the stream in a `\Psr\Http\Message\StreamInterface` object (for example `new \Zend\Diactoros\Stream($fp)`), there's not really much else you can do. |
# |
Jul 18th 2019, 13:15 |
spriz |
If you find something awesome, feel free to post a gist! :) |
# |
Jul 18th 2019, 13:12 |
neon1024 |
Thanks for the insight though @spriz I’ll have a go with some ideas |
# |
Jul 18th 2019, 13:12 |
neon1024 |
Yeah, that’s why I thought I’d just assert the Query instance |
# |
Jul 18th 2019, 13:11 |
spriz |
which is quite well done anyway :) |
# |
Jul 18th 2019, 13:11 |
spriz |
+ I feel I end up testing the ORM itself |
# |
Jul 18th 2019, 13:11 |
spriz |
maybe `(` was added or something like taht |
# |
Jul 18th 2019, 13:11 |
spriz |
Nah, it just sucks that tests fail because some optimizations were pushed in the ORM or something like that |
# |
Jul 18th 2019, 13:10 |
neon1024 |
@spriz Oh no, is it that much of a pain! :grimacing: |
# |
Jul 18th 2019, 13:10 |
neon1024 |
I guess I could use the callback to make an array and assert that |
# |
Jul 18th 2019, 13:10 |
spriz |
which suck |
# |
Jul 18th 2019, 13:10 |
spriz |
No good answers from me, then. Besides checking raw SQL |
# |
Jul 18th 2019, 13:10 |
neon1024 |
Sometimes it adds contain and where, sometimes just where, etc |
# |
Jul 18th 2019, 13:10 |
spriz |
I found that troublesome previously |
# |
Jul 18th 2019, 13:10 |
spriz |
Ah yes |
# |
Jul 18th 2019, 13:09 |
neon1024 |
I have a behaviour which appends conditions to a query. I’d like to unit test it with various queries to ensure it’s doing what I expect |
# |
Jul 18th 2019, 13:09 |
spriz |
the the correct things were actually applied with ->where() ? |
# |
Jul 18th 2019, 13:09 |
spriz |
what do you want to test? |
# |
Jul 18th 2019, 13:09 |
spriz |
I'd assert on the SQL if i wanted to be that specific |
# |
Jul 18th 2019, 13:08 |
neon1024 |
I’m not sure how I would assert in a loop like that, I’d much prefer `$where->getConditions(): array` but it doesn’t seem to be in the API unless I’ve missed it |