# |
Jul 24th 2018, 13:55 |
neon1024 |
SecondRequestWithCookie |
# |
Jul 24th 2018, 13:55 |
neon1024 |
No, new test. |
# |
Jul 24th 2018, 13:54 |
drollie |
function |
# |
Jul 24th 2018, 13:54 |
drollie |
no, same test |
# |
Jul 24th 2018, 13:54 |
neon1024 |
As the cookie not being sent on a subsequent request is a new test |
# |
Jul 24th 2018, 13:54 |
drollie |
the cookie does not seem to get set automatically when I make a second request... |
# |
Jul 24th 2018, 13:54 |
neon1024 |
I would think you should ensure that it’s sent |
# |
Jul 24th 2018, 13:54 |
drollie |
yes, integration test |
# |
Jul 24th 2018, 13:54 |
neon1024 |
It’s an integration test |
# |
Jul 24th 2018, 13:53 |
drollie |
If I make the request a second time, will the cookie be sent to the server, or do I need to call $this->cookie() to set it before making additional requets? |
# |
Jul 24th 2018, 13:53 |
neon1024 |
Then it isn’t a unit test ;) |
# |
Jul 24th 2018, 13:53 |
drollie |
In my controller unit test, I make a request to the server which sets a cookie: $this->get(... |
# |
Jul 24th 2018, 13:32 |
lubos |
Another Mailer question, in the Mailer method the `send` is executed I would say magically. How can I check send was successful? Should I call send manually and do condition like `if ($this->send()) ...` ? |
# |
Jul 24th 2018, 11:24 |
willem |
also, it is working when i run the command on the command line, only from Cake i get this error |
# |
Jul 24th 2018, 11:24 |
lubos |
@edgaras.jan works like a dream, thanks for hint. Not sure if right concept though :slightly_smiling_face: |
# |
Jul 24th 2018, 11:22 |
willem |
i did, but i do not quite understand, something with memory, but do not get why it is working locally |
# |
Jul 24th 2018, 11:21 |
admad |
google it :slightly_smiling_face: |
# |
Jul 24th 2018, 11:16 |
willem |
using CakePDF to render to PDF using wkhtmltoPDF works great on my local machine. on testserver environment online i get this error ``` 'std::bad_alloc' what(): std::bad_alloc Aborted " when executing command "/usr/local/bin/wkhtmltopdf --quiet --print-media-type ``` what does this mean? |
# |
Jul 24th 2018, 11:16 |
lubos |
Ah, clever. will give it a try |
# |
Jul 24th 2018, 11:14 |
edgaras.jan |
then call $email->setSubject('abc') from view |
# |
Jul 24th 2018, 11:13 |
edgaras.jan |
You could set Email as view var $email = new Email(); $email->set(['email' => $email]); |
# |
Jul 24th 2018, 11:12 |
lubos |
Should I write and use custom viewRender? |
# |
Jul 24th 2018, 11:08 |
lubos |
My aim is to parse data (using Text insert) for subject and email body |
# |
Jul 24th 2018, 11:07 |
lubos |
When I use Mailer class, is it possible to set subject from template? Something like $this->setLayout('abc')... |
# |
Jul 24th 2018, 10:37 |
neon1024 |
Yes, I’m on PHP Storm 2018.1 |
# |
Jul 24th 2018, 10:37 |
dereuromark |
not sure if other ides support this meta file |
# |
Jul 24th 2018, 10:36 |
dereuromark |
because this magic is phpstorm specific ( https://github.com/dereuromark/cakephp-ide-helper/blob/master/src/Generator/PhpstormGenerator.php ) |
# |
Jul 24th 2018, 10:35 |
neon1024 |
Will do that now, thanks :thumbsup: |
# |
Jul 24th 2018, 10:35 |
neon1024 |
Oh right, I haven’t run the helper plugin in a while |
# |
Jul 24th 2018, 10:35 |
dereuromark |
you use phpstorm? |
# |
Jul 24th 2018, 10:35 |
dereuromark |
https://github.com/dereuromark/cakephp-ide-helper/blob/master/src/Generator/Task/TableFinderTask.php#L57 |
# |
Jul 24th 2018, 10:34 |
dereuromark |
afaik I have that already |
# |
Jul 24th 2018, 10:34 |
dereuromark |
similar to what I did for e.g. QueuedJobs::addJob() |
# |
Jul 24th 2018, 10:34 |
dereuromark |
yeah you need to add find() here |
# |
Jul 24th 2018, 10:34 |
neon1024 |
`$this->Scripts->find('complete)` |
# |
Jul 24th 2018, 10:33 |
neon1024 |
`protected function findComplete(Query $query, array $options = []): Query` |
# |
Jul 24th 2018, 10:33 |
dereuromark |
example? |
# |
Jul 24th 2018, 10:33 |
neon1024 |
So they can be CMD clicked to reach the table class method? |
# |
Jul 24th 2018, 10:33 |
neon1024 |
@dereuromark Can I somehow add IDE hints for custom finders? |
# |
Jul 24th 2018, 10:26 |
bernat |
I'm doing that but it's like a global. It might get overriden. Not ideal. |
# |
Jul 24th 2018, 10:26 |
tim |
Can you define a route where `/:id` is optional or do you have to make 2 routes? |