vendredi 27 novembre 2015

Laravel firstOrCreate with filter by selected attribute not working on my testing

i have some problem on testing when i'm using findOrCreate method. This is my example code :

$template = Template::firstOrCreate($temp, ["user_id"=>$id, "project_id"=>$target_id]);       

on my app development, this method is working. Template has created if 'user_id' and 'project_id' not found, but when i'm run via testing with phpunit this code always error like bellow :

Trying to get property of non-object

need help, i'm feeling crazy on this case....

Aucun commentaire:

Enregistrer un commentaire