Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

yii2 - Cannot use root project directory as source for phpspec

I have this project structure in Yii2 Framework:

www
-- controllers
-- models
-- services
---- SomeService.php
-- bin
---- phpspec
-- spec
---- services
------ SomeServiceSpec.php
-- phpspec.yml

I want to use SomeServiceSpec.php to test SomeService.php. My phpspec.yml:

formatter.name: pretty
suites:
    default:
      namespace: app
      psr4_prefix: app
      src_path: ./

The namespace of service is app/services/ but here is no real app folder.

When I do bin/phpspec run' I have the error class appservicesSomeService does not exist.`. Then it asks if I want it to be created. If I agree it ask if I want it to be overwritten!

I was trying to set src_path as ., /, %paths.config% but it does not help.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...