Search code examples
phpbddphpspec

PhpSpec Can not find appropriate suite scope for class error


I am just starting out with PhpSpec. When I do this:

bin/phpspec desc src/CRMPicco/GolfBundle/Controller/CourseGuideController

I get the following error:

  [PhpSpec\Exception\Locator\ResourceCreationException]
  Can not find appropriate suite scope for class `src/CRMPicco/GolfBundle/Controller/CourseGuideController`.

I created an empty CourseGuideController class in that directory so the class exists.

My phpspec.yml:

suites:
    CRMPiccoGolfBundle: { namespace: CRMPicco, spec_path: src/CRMPicco/GolfBundle }

CourseGuideController.php:

namespace CRMPicco\GolfBundle\Controller;

class CourseGuideController
{

}

Solution

  • try: bin/phpspec desc CRMPicco/GolfBundle/Controller/CourseGuideController