# |
Sep 3rd 2019, 10:51 |
conehead |
Yes that is what I am trying to do :P |
# |
Sep 3rd 2019, 10:49 |
neon1024 |
They’re your tests! If you’re confident in your suite, make your changes :slightly_smiling_face: |
# |
Sep 3rd 2019, 10:49 |
conehead |
The controller just does stuff in the background I don't care about |
# |
Sep 3rd 2019, 10:49 |
neon1024 |
Yep, one of my projects the test suite takes 30 minutes |
# |
Sep 3rd 2019, 10:48 |
conehead |
Just doing normal controller tests. But already takes like 10 minutes now |
# |
Sep 3rd 2019, 10:48 |
neon1024 |
Has anyone tried to use `riesenia/cakephp-duplicatable` with hasMany? I’d like to duplicate my hasMany records, but trying to unset the association `id` fields is causing a headache |
# |
Sep 3rd 2019, 10:45 |
neon1024 |
So you can load your dashboard and test `->canSee('#user-details')` etc |
# |
Sep 3rd 2019, 10:45 |
neon1024 |
Using something like Codeception |
# |
Sep 3rd 2019, 10:45 |
neon1024 |
Perhaps you’re looking for acceptance tests? |
# |
Sep 3rd 2019, 10:45 |
neon1024 |
If they test the right stuff is more important to me |
# |
Sep 3rd 2019, 10:44 |
neon1024 |
Dunno about you, but performance of tests aren’t relevant to me |
# |
Sep 3rd 2019, 10:43 |
conehead |
So it's more a performance thing |
# |
Sep 3rd 2019, 10:43 |
conehead |
I am using a dashboard and this dashboard always shows several data (e.g. user details). There are like 10 tables I have to load the fixtures for, although it is not important for the test. So I thought I could just mock it out |
# |
Sep 3rd 2019, 10:38 |
neon1024 |
Doesn’t sound very integrated ;) |
# |
Sep 3rd 2019, 10:37 |
neon1024 |
Why would you need a mock in an integration test? |
# |
Sep 3rd 2019, 10:35 |
conehead |
Ah, I can just set the Helper, even for a integration test? |
# |
Sep 3rd 2019, 10:32 |
neon1024 |
Although helpers may take a View instance as contructor param, so you might need `->setConstructorArgs()` |
# |
Sep 3rd 2019, 10:32 |
neon1024 |
If you’re using PHP Unit that is |
# |
Sep 3rd 2019, 10:31 |
neon1024 |
Sure I tend to use `$helper = $this->getMockBuilder(\App\View\MyHelper::class)->getMock();` |
# |
Sep 3rd 2019, 10:24 |
conehead |
hm anyone know how/if it is possible to Mock Helpers for testing? |
# |
Sep 3rd 2019, 10:13 |
neon1024 |
The entity should have `isNew()` |
# |
Sep 3rd 2019, 10:13 |
val |
How to check whether a new record was created or the existing update in Table::afterSave() in 3.x? |
# |
Sep 3rd 2019, 10:10 |
neon1024 |
Not sure why it doesn’t check it’s an array first :man-shrugging: |
# |
Sep 3rd 2019, 10:10 |
neon1024 |
https://github.com/riesenia/cakephp-duplicatable/blob/master/src/Model/Behavior/DuplicatableBehavior.php#L267 |
# |
Sep 3rd 2019, 10:10 |
neon1024 |
> Warning (2): Invalid argument supplied for foreach() [ROOT/vendor/riesenia/cakephp-duplicatable/src/Model/Behavior/DuplicatableBehavior.php, line 268] |
# |
Sep 3rd 2019, 10:10 |
neon1024 |
Anyone seen this one before? |
# |
Sep 3rd 2019, 10:01 |
Nitrogen |
here it is https://pastebin.com/ukPVF4Q1 |
# |
Sep 3rd 2019, 09:58 |
Nitrogen |
have anyone seen my validation-related question from earlier today? we might have a problem there. |
# |
Sep 3rd 2019, 09:57 |
spriz |
COOurb I am not using that functionality myself so I cannot help you then :slightly_smiling_face: |
# |
Sep 3rd 2019, 09:57 |
COOurb |
after adding 'dir' field in settings |
# |
Sep 3rd 2019, 09:56 |
COOurb |
files still cannot be deleted |
# |
Sep 3rd 2019, 09:56 |
COOurb |
spriz |
# |
Sep 3rd 2019, 09:55 |
COOurb |
still |
# |
Sep 3rd 2019, 09:40 |
COOurb |
but file still in directory |
# |
Sep 3rd 2019, 09:40 |
COOurb |
oh, ok, I had to put in "fieldname" settings group |
# |
Sep 3rd 2019, 09:40 |
dereuromark |
Good news for the IDE people: View template variable collecting is now in master - if someone wants to test the new IdeHelper functionality. |
# |
Sep 3rd 2019, 09:39 |
COOurb |
already, but nvalid data type, must be an array or \ArrayAccess instance. |
# |
Sep 3rd 2019, 09:38 |
spriz |
try setting `'keepFilesOnDelete'` => false` |
# |
Sep 3rd 2019, 09:38 |
spriz |
Hint: You need to let it not go into this `if()` https://github.com/FriendsOfCake/cakephp-upload/blob/master/src/Model/Behavior/UploadBehavior.php#L133 |
# |
Sep 3rd 2019, 09:36 |
COOurb |
I don't have special field for 'dir' |
# |
Sep 3rd 2019, 09:36 |
spriz |
Nope, only if you set the right configs :slightly_smiling_face: See the code in the behavior and it will make sense |