0

I'm starting to work with phpspec and I'm struggling with this problem. I'm having a spec code like this :

class OrderItemSpec extends ObjectBehavior
{
    function it_is_initializable()
    {
        $this->shouldHaveType('Ts\Project\Model\OrderItem');
    }

    function it_is_a_model()
    {
        $this->shouldImplement('Ts\Generic\Model');
    }
}

Model interface class:

namespace Ts\Generic;

interface Model
{
}

When running phpspec it always ask me:

 Do you want me to create `Ts\Generic\Model` for you?


 File "Model.php" already exists. Overwrite?

When overwriting, he changes interface to a regular class.

In composer I have autoload configured like this :

"autoload": {
      "psr-0": {
        "": "src"
      }
  }

Is it a phpspec error, limitation or am I doing it in a wrong way ?

eMZet
  • 1
  • 1
  • 2
  • Looks to be an issue with your autoloading – nathanmac Aug 18 '15 at 11:43
  • @nathanmac But when I change to a regular class and extend it instead of implement an interface everything works fine. – eMZet Aug 18 '15 at 11:52
  • Ok, actually it was an autoloading problem. Probably didn't use dump-autoload when posting this question. Now everything works. Thx – eMZet Aug 18 '15 at 11:59

0 Answers0