Codeception trait 'Codeception\Specifiy' not found
I have a PHP app that we are adding tests to using Codeception. We tried to add Specify (and Verify) to our suite but it isn't being recognized. how do you correctly set up Specify for use with Codeception?
In my composer.json, I have the following:
{
"require-dev": {
"codeception/codeception": "2.0.11",
"codeception/specify": "*",
"codeception/verify": "*"
}
}
I ran composer update after adding specify and verify and got this output:
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing myclabs/deep-copy (1.3.0)
Downloading: 100%
- Installing codeception/specify (0.4.1)
Downloading: 100%
- Installing codeception/verify (0.2.7)
Downloading: 100%
Writing lock file
Generating autoload files
I have a test like this (mostly what was made from generate:test) :
<?php
class ServiceTest extends \Codeception\TestCase\Test
{
use \Codeception\Specifiy;
/**
* @var \UnitTester
*/
protected $tester;
protected function _before()
{
}
protected function _after()
{
}
// tests
public function testCall() {
$this->specify("An instance of the service is invoked");
}
}
When I run my unit tests, I get the output:
Fatal error: Trait 'Codeception\Specifiy' not found in /Users/person/neat_app/tests/unit/ServiceTest.php on line 6
The references I'm using are: http://codeception.com/10-04-2013/specification-phpunit.html and https://github.com/Codeception/Specify
What am I missing to have have Specify visible to my test runner?
EDIT: I have to invoke my tests like this - ./vendor/bin/codecept run unit
Not just by typing codecept at the application directory. Does this hint towards something wrong with my installation of Codeception?
Solution 1:
It is \Codeception\Specify
and not \Codeception\Specifiy