I am setting up a new Laravel project and integrating PHPSpec. I am having trouble finding a good working example of the phpspec.yml file that would work neatly with Laravel. In a similar way to RSpec in Rails.
My desired folder structure would be as follows
spec/
models/
controllers/
app/
models/
controllers/
My phpspec.yml currently looks like this:
suites:
controller_suite:
namespace: Controller
spec_path: 'spec/controllers'
src_path: 'app/controllers'
model_suite:
namespace: Model
spec_path: 'spec/models'
src_path: 'app/models'
I copied my Model related tests in the spec/models folder, but when I 'phpspec run' it does not run any of them. I also realise that the namespace is not 'Model' and 'Controller' in Laravel, perhaps more like Eloquent and BaseController..
I am also using this extension: https://github.com/BenConstable/phpspec-laravel
I'm not sure how to set this up and cannot find any working examples. Thanks in advance!
EDIT: Advice founbd on another forum from Jeffrey Way:
You can test your controllers with Behat. PHPSpec isn't a substitute for it (or Codeception).
UPDATE:
I've since decided to use Codeception instead as it seems to integrate neatly into Laravel and widely used.