Re: CakePHP 3 Unit Testing: posting data does not seem to be refactored by request object

2015-05-11 Thread HVan
Maybe I'm also doing something wrong with the Request object. In the Integration Controller Test, when I $this->cookie('x',y'); And in the controller when I $this->loadComponent('Cookie'); print_r($this->Cookie->read('x')); Nothing displays. Am I doing it the right way or is something missing?

CakePHP 3 Unit Testing: posting data does not seem to be refactored by request object

2015-05-11 Thread HVan
I wrote a test that posts data like this: $data = [ 'Clients[username]'=>'asdf' ]; $this->post('/url',$data); In the controller method, when I print_r $this->request->data, it displays as this: [ 'Clients[username]'=>'asdf' ] However, if I go through a browser instead of phpunit, it is formed

Re: Fixtures for Models that use another Model's table

2015-05-11 Thread HVan
Nevermind - I think I found the problem. I forgot to reference the proper namespace because both models are in 2 separate plugins. On Monday, May 11, 2015 at 8:46:49 PM UTC-7, HVan wrote: > > I have a Model, say ClientsTable, and another Model called UsersTable. > > ClientsTable also uses the use

Fixtures for Models that use another Model's table

2015-05-11 Thread HVan
I have a Model, say ClientsTable, and another Model called UsersTable. ClientsTable also uses the users table, so I set useTable = users Everything works fine, until I'm creating tests. One of the tests says the clients table is not found. So if I create a clients fixture and import the users t

Re: Custom helpers not available on error pages

2015-05-11 Thread LDSign
Ok, thanks :) How can I do this (overriding a core helper on these error pages)? Regards, Frank Am Montag, 11. Mai 2015 18:25:25 UTC+2 schrieb LDSign: > > Hi > > Ive set up some custom error pages which include the main layout > (including navigation) for e.g. "page not found" errors. In the >

Re: Custom helpers not available on error pages

2015-05-11 Thread José Lorenzo
If I remember correctly (some) Error pages do not load from app controller, so it is safer if for the error pages you explicitly load the helpers you need. On Monday, May 11, 2015 at 6:25:25 PM UTC+2, LDSign wrote: > > Hi > > Ive set up some custom error pages which include the main layout > (i

Custom helpers not available on error pages

2015-05-11 Thread LDSign
Hi Ive set up some custom error pages which include the main layout (including navigation) for e.g. "page not found" errors. In the header-element included I make use of a custom helper (MyTextHelper extends TextHelper). Unfortunatley this custom helper is not used in the error page resulting i

Re: How to set Cake 3.0 to save with different date format ?

2015-05-11 Thread Joe T.
Here's a pastebin (paid for it, might as well use it). It occurred to me there was something i hadn't tried. i've been using an accessor function in the Entity to format the field to m/d/Y for screen. Without it, i get the time (12:00 AM), and the date digits don'

Re: How to set Cake 3.0 to save with different date format ?

2015-05-11 Thread José Lorenzo
This line means that you are storing in the entity an string, why do you that? Also, how are you saving the data, can you use gist to show all your code? return $this->_properties['ready_date']->format('Y-m-d'); On Monday, May 11, 2015 at 7:18:50 AM UTC+2, Joe T. wrote: > > i found this topic h