# |
Dec 14th 2017, 10:24 |
neon1024 |
Making your unit tests easier to write, your system under test smaller, and your tests more predictable |
# |
Dec 14th 2017, 10:24 |
neon1024 |
At least then when you come to test, you can easily pass in fixed dependencies |
# |
Dec 14th 2017, 10:23 |
neon1024 |
https://en.wikipedia.org/wiki/SOLID_(object-oriented_design) |
# |
Dec 14th 2017, 10:23 |
neon1024 |
Remember SOLID |
# |
Dec 14th 2017, 10:23 |
neon1024 |
Never reach out for dependencies |
# |
Dec 14th 2017, 10:22 |
birdy247 |
@neon1024 so pass them in as options rather than looking them up internally |
# |
Dec 14th 2017, 10:18 |
neon1024 |
Otherwise you’ll make writing unit tests very hard |
# |
Dec 14th 2017, 10:18 |
neon1024 |
If they’re that interdependent then you need to refactor |
# |
Dec 14th 2017, 10:11 |
birdy247 |
as Method B relies on Method C and Method D (which I am stubbing) |
# |
Dec 14th 2017, 10:10 |
birdy247 |
I am not sure if using too many stubs is considered wrong |
# |
Dec 14th 2017, 10:08 |
birdy247 |
@neon1024, I have 1/ unit tested Method B, 2/ unit test Method A with a stub for B |
# |
Dec 14th 2017, 10:07 |
neon1024 |
If you’re asking the question, then you already know the answer |
# |
Dec 14th 2017, 10:04 |
birdy247 |
^^ in the context of testing Method A |
# |
Dec 14th 2017, 10:04 |
birdy247 |
If I am testing method A, who's outcome is affected by an internal call to Method B, would this be a candidiate for mocking Method B? |
# |
Dec 14th 2017, 09:56 |
meowcate |
That means I'll need to do many separated calls to mysql. Maybe there is a better way, just asking. |
# |
Dec 14th 2017, 09:54 |
meowcate |
As far as I know with the book, to save many entites I need to put the datas in an array, but for the translations I have to use `$entity->translation(lang)->set(data))` to save each translation in a loop |
# |
Dec 14th 2017, 09:52 |
meowcate |
Is there a way I can save many entities at once with their translations, or do I need to save each entity and its translations though a loop ? |
# |
Dec 14th 2017, 09:49 |
neon1024 |
But not a plugin as my admin area will not be implemented into a different project |
# |
Dec 14th 2017, 09:49 |
neon1024 |
As I like the code separation |
# |
Dec 14th 2017, 09:49 |
neon1024 |
I use a prefix personally |
# |
Dec 14th 2017, 09:48 |
psantos |
so, you would use prefix or scope for admin area? |
# |
Dec 14th 2017, 09:47 |
neon1024 |
Some word in IRC translates into a mention here in slack somehow, it’s quite confusing :P |
# |
Dec 14th 2017, 09:46 |
neon1024 |
For some reason here in slack we see “but thats does not @work" |
# |
Dec 14th 2017, 09:46 |
joopm |
should? |
# |
Dec 14th 2017, 09:46 |
neon1024 |
Does not what? |
# |
Dec 14th 2017, 09:46 |
neon1024 |
work |
# |
Dec 14th 2017, 09:46 |
joopm |
but thats does not work |
# |
Dec 14th 2017, 09:46 |
joopm |
i tried $this->ModelName->FieldName |
# |
Dec 14th 2017, 09:45 |
joopm |
but should i refere for the different Model's field? |
# |
Dec 14th 2017, 09:45 |
joopm |
i know i can use $context['data']['fieldName'] for current model |
# |
Dec 14th 2017, 09:44 |
joopm |
which is based on other's modell field value |
# |
Dec 14th 2017, 09:44 |
joopm |
i have to write a custome validation rule |
# |
Dec 14th 2017, 09:44 |
joopm |
hello there |
# |
Dec 14th 2017, 09:41 |
slackebot |
could not be found.` What I am missing? |
# |
Dec 14th 2017, 09:41 |
psantos |
routes from 2.x was more easy to handle... for example, now I have this: ``` $routes->connect( '/categories/:id', ['controller' => 'Categories', 'action' => 'view'] )->setPatterns(['id' => '\d+'])->setPass(['id']); ``` but when I try to visit `http://localhost:8765/categories/1` for example, I got this error: `Error: A route matching "array ( 'controller' => 'posts', 'action' => 'view', 0 => 6, 'plugin' => NULL, '_ext' => NULL, )" |
# |
Dec 14th 2017, 09:34 |
neon1024 |
Sense it none makes. |
# |
Dec 14th 2017, 09:32 |
meowcate |
I'm not sure I understand your question. |
# |
Dec 14th 2017, 09:28 |
extreminator |
how to define array like name attribute every time i get new select box using jquery |
# |
Dec 14th 2017, 09:28 |
neon1024 |
No harm in it though, just you have to remember that it’s there and code for it |
# |
Dec 14th 2017, 09:28 |
neon1024 |
I wouldn’t make an admin area in a plugin personally, just because it makes things more frustrating to maintain, as all your routes and table classes etc need to manage the plugin |
# |
Dec 14th 2017, 09:17 |
psantos |
good morning @furqan |