This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
My plugin depends on the RainLab.User plugin so I’ve added it as a dependency by adding
public $require = ['RainLab.User'];
in my Plugin.php file.
Now I need to listen for a few model events being triggered on the RainLab.User model in the boot() method and handle them as needed. The trouble is that calling User::create(), always and as expected, triggers the "afterCreate" event no matter where it is called EXCEPT when it's called from within a phpunit test. So creating User records in a test does not trigger these model events. Any pointers how we can make the test be aware of such events originating on dependency plugins?
Found a solution yet? I'm having the same problem and I can't seem to find any documentation on this matter. You said that the "afterCreate" event is NOT triggered in phpunit. Is that a guess or do you know?
hey i want to create a model for save the form but i dont know where to create the model please help me out
hey i want to create a model for save the form but i dont know where to create the model please help me out
1-4 of 4