# |
Jul 3rd 2018, 08:27 |
birdy247 |
$this->post('/members/add', $data); $this->assertRedirect(['controller' => 'InvoiceItems', 'action' => 'basket']); |
# |
Jul 3rd 2018, 08:25 |
james.phillips |
If I dont have a view method it works without a template... |
# |
Jul 3rd 2018, 08:25 |
tim |
Which one? :P |
# |
Jul 3rd 2018, 08:25 |
birdy247 |
The asserts fail |
# |
Jul 3rd 2018, 08:25 |
tim |
@birdy247 Where is it failing? |
# |
Jul 3rd 2018, 08:25 |
tim |
Did you create the template for it? Or if you want the default, you have to explicitly tell it to use that. By default controllers look for templates in Templates\ControllerName\methodName.ctp |
# |
Jul 3rd 2018, 08:25 |
james.phillips |
I assumed I dont need a view.ctp as it should return json using crud-json-api |
# |
Jul 3rd 2018, 08:23 |
birdy247 |
when it runs on our pipleine (server), it fails |
# |
Jul 3rd 2018, 08:23 |
james.phillips |
Hi lol, I'm using crud-json-api and for some controllers I want to do my own view/index etc methods but I get Template file \"Api/V1/CrmContacts/view.ctp\ is missing errors. Im not sure how im suppose to return the data from the view method. |
# |
Jul 3rd 2018, 08:22 |
birdy247 |
I have a odd problem in that when I run a integration test locally, it passes |
# |
Jul 3rd 2018, 08:19 |
tim |
@james.phillips It's trying to load a contain/association on "_query". What are you trying to achieve? |
# |
Jul 3rd 2018, 08:18 |
tim |
No I was kidding about the touch() part :slightly_smiling_face: |
# |
Jul 3rd 2018, 08:18 |
james.phillips |
Do I need to ask for consent for something? sorry new here |
# |
Jul 3rd 2018, 08:15 |
magiq |
hmic: thank you |
# |
Jul 3rd 2018, 08:13 |
liaogz82 |
I'm sorry how do I capture output? |
# |
Jul 3rd 2018, 08:12 |
tim |
Ask for consent first |
# |
Jul 3rd 2018, 08:10 |
hmic |
magiq, just touch() the entity to trigger it |
# |
Jul 3rd 2018, 08:06 |
james.phillips |
does anyone know what Table "App\Model\Table\CrmContactsTable" is not associated with "_query" means? |
# |
Jul 3rd 2018, 07:54 |
james.phillips |
Hi does anyone use crud-json-api? |
# |
Jul 3rd 2018, 07:36 |
lubos |
Just found out I can't change foreign key, that's why created_by was not set to dirty. Been there before :slightly_smiling_face: |
# |
Jul 3rd 2018, 07:27 |
lubos |
UseMuffin/Footprint behavior, trying to manually patch `created_by` property in entity, but it does not let me. Do I need to disable behavior when trying to do so? |
# |
Jul 3rd 2018, 07:21 |
magiq |
How to save entity with no changes? I just want to trigger timestamp behaviour |
# |
Jul 3rd 2018, 07:09 |
lubos |
FriendsOfCkae/Search behavior, I can see I can set `colType => ['release_date' => 'date']` with searchManager. Is it possible to use custome date format? I mean I am able to search by DB date format `Y-m-d`, but I would like to use `d/m/Y` |
# |
Jul 3rd 2018, 06:58 |
liaogz82 |
what kind of asserts I should use? |
# |
Jul 3rd 2018, 06:52 |
dakota |
As for testing it, controller tests allow you to capture the output, which you can then compare against a known CSV file |
# |
Jul 3rd 2018, 06:51 |
dakota |
https://github.com/FriendsOfCake/cakephp-csvview |
# |
Jul 3rd 2018, 06:51 |
dakota |
@liaogz82 Best tool is the CsvView plugin from FriendsOfCake |
# |
Jul 3rd 2018, 06:38 |
liaogz82 |
how do I read the exported data using unit test? |
# |
Jul 3rd 2018, 06:23 |
hmic |
liaogz82: whz not read it and compare to the data you tried to export in the first place? |
# |
Jul 3rd 2018, 06:20 |
liaogz82 |
and how do I write unit test that the export is indeed a CSV file? |
# |
Jul 3rd 2018, 06:17 |
hmic |
the reason is obvious though, you do have an input with no name assigned. |
# |
Jul 3rd 2018, 06:16 |
hmic |
mohitprakashsharma555: this looks like an js error to me. |
# |
Jul 3rd 2018, 06:02 |
liaogz82 |
hi guys, what are the best tools/library for CSV export in cake 3.5? |
# |
Jul 3rd 2018, 04:59 |
mohitprakashsharma555 |
hey gusy i am why i am getting `An invalid form control with name='' is not focusable.` this error |
# |
Jul 3rd 2018, 04:37 |
humbba12 |
thank you for your advice! |
# |
Jul 3rd 2018, 03:45 |
hmic |
chrisshick: your advice on the table structure of the settigns table is wrong too IMHO. you don't create columns for each setting but key/value fields only to save your settings! |
# |
Jul 3rd 2018, 03:43 |
hmic |
user settings usually go with a user_settings table, this is things like a currency or language for example |
# |
Jul 3rd 2018, 03:42 |
hmic |
enviromnent settings go with app_local.php for me, or just .env files, i personally keep api keys there too most of the time, because thez differ from the envs too |
# |
Jul 3rd 2018, 03:40 |
hmic |
i would want to implement different means of setting these! |
# |
Jul 3rd 2018, 03:39 |
hmic |
humbba12: you should consider different ways to have these settings stored. you seem to mix up different things here, like: environment dependent settigns (sandbox/production), you have settigns an admin might want/need to change - which might need to be protected in some way (like the payment api key) and application settings, maybe even user settings, like the currency |
# |
Jul 3rd 2018, 03:29 |
chrisshick |
No problem |