# |
Jul 13th 2017, 14:44 |
neon1024 |
I would recommend unit testing the methods in your worker, probably using a fixutre |
# |
Jul 13th 2017, 14:44 |
sauvaget |
Hey guys, I am having a little problem writing some Tests. I am using @dereuromark cakephp-queue plugin. Now I have a test for the QueueShell. But I would also like to test my actual tasks. Unfortunatly there is no example file for that case and I am still pretty noobie testing wise. Has anybody got an example lying around? |
# |
Jul 13th 2017, 14:28 |
ericadeefox |
day 2 of this error message: `Cake\Routing\Exception\MissingControllerException: Controller class could not be found.` |
# |
Jul 13th 2017, 14:27 |
ericadeefox |
^I use that! it's 10/10, really easy to set up, makes it super easy to build queries, lmk if you want to see how I use it @johnwayne |
# |
Jul 13th 2017, 14:26 |
neon1024 |
I’d use the friendsofcake/search plugin personally |
# |
Jul 13th 2017, 14:18 |
johnwayne |
my idea was to explode string and for each word make where 'Table.column_name Like' =>'%'.$search_term.'%'... |
# |
Jul 13th 2017, 14:17 |
johnwayne |
What is the best practice to build a query with a multi-word search string, searching multiple fields and/in multiple tables? |
# |
Jul 13th 2017, 14:09 |
nemmons |
@jack-sparrow in the first iteration of the foreach loop, `$arrOfFields[$value]['option_labels'][$t]['count']` hasn't been defined yet. You could solve this by adding (on line 36 of the pastebin code) `$arrOfFields[$value]['option_labels'][$t]['count'] = 0;` |
# |
Jul 13th 2017, 14:08 |
nemmons |
@devito https://book.cakephp.org/3.0/en/orm/validation.html is a good overview. It looks like it says you should be able to validation before saving |
# |
Jul 13th 2017, 13:47 |
devito |
cause something odd happened to me last night. i went to check entity->errors() before i save and its empty but after i attempt to save its got errors in it. is that the propper way to check? |
# |
Jul 13th 2017, 13:44 |
devito |
do validation errors get set after a save attempt or before? |
# |
Jul 13th 2017, 13:42 |
jack-sparrow |
https://pastebin.com/dRBTeCQF here i am getting //error : Warning (2): Illegal string offset 'count'.. i want to store how many time i got the specifc values like "Less than 6 months" count |
# |
Jul 13th 2017, 13:02 |
obinoob |
for values that are not obligatory in view I use the ->has('property') in case I need property->name can i use "has"? |
# |
Jul 13th 2017, 12:55 |
clementcrown |
if $sub <1, I still get the $audiomax and the rest complaining of variable undefined |
# |
Jul 13th 2017, 12:54 |
clementcrown |
@mikesmoniker above is my code |
# |
Jul 13th 2017, 12:42 |
mikesmoniker |
@clementcrown You’re referencing a variable $sub) that hasn’t been defined (yet), but we can’t tell much else from that one line alone. |
# |
Jul 13th 2017, 12:23 |
clementcrown |
any idea ? |
# |
Jul 13th 2017, 11:58 |
clementcrown |
for example, i do get this Notice (8): Undefined variable: sub [APP/Controller\SubscriptionsController.php, line 67] in my view..... |
# |
Jul 13th 2017, 11:57 |
hmic |
admad: i guess he is talking about something like: $arr['key'] = null; |
# |
Jul 13th 2017, 11:56 |
admad |
"how can i destroy something that doesn't exist" |
# |
Jul 13th 2017, 11:55 |
clementcrown |
hi, how can I unset a variable if it does not have any value assigned to it? i tried using unset($variable) but it didnt work |
# |
Jul 13th 2017, 11:47 |
admad |
src/YouDontSeeMe is also a good location |
# |
Jul 13th 2017, 11:39 |
savant |
or next to the classes where the exception is used |
# |
Jul 13th 2017, 11:38 |
savant |
src/Exception |
# |
Jul 13th 2017, 11:38 |
neon1024 |
Where do people put their own exceptions? https://book.cakephp.org/3.0/en/development/errors.html#creating-your-own-application-exceptions |
# |
Jul 13th 2017, 11:38 |
savant |
RC1 came out two weeks ago, RC2 will be soon |
# |
Jul 13th 2017, 11:38 |
savant |
release date depends on what else is necessary |
# |
Jul 13th 2017, 11:38 |
savant |
it’ll be done when its done |
# |
Jul 13th 2017, 11:37 |
Bigsista |
hi all. is there a final release date for cakephp 2.10 already? |
# |
Jul 13th 2017, 11:04 |
neon1024 |
Ooh, nice. The whole Schema vs Schema class name thing has been resolved :) |
# |
Jul 13th 2017, 10:49 |
slackebot |
Action: neon1024 earns the Slack Noob badge |
# |
Jul 13th 2017, 10:49 |
neon1024 |
Urgh, code paste fail |
# |
Jul 13th 2017, 10:49 |
neon1024 |
``` |
# |
Jul 13th 2017, 10:49 |
neon1024 |
``` protected function getRequest(): ServerRequest { return $this ->getController() ->request; } |
# |
Jul 13th 2017, 10:49 |
neon1024 |
Confused myself here I think! |
# |
Jul 13th 2017, 10:48 |
neon1024 |
Hah, well, let’s hope not ;) |
# |
Jul 13th 2017, 10:48 |
savant |
unless you’re doing something stupid like reassigning it to a client. |
# |
Jul 13th 2017, 10:48 |
neon1024 |
Cool, thanks guys :thumbsup: |
# |
Jul 13th 2017, 10:47 |
savant |
basically 100% of the time |
# |
Jul 13th 2017, 10:47 |
savant |
ServerRequest is used in the dispatch cycle |
# |
Jul 13th 2017, 10:47 |
neon1024 |
Right, so *most* of the time when I’m in a controllers request it’s a PSR7 type ServerRequest then right? |