PHP seems to be trying to compile the same trait twice.
use Behat\MinkExtension\Context\MinkDictionary;
class FeatureContext
{
use MinkDictionary, OrderDictionary;
}
use Behat\MinkExtension\Context\MinkDictionary;
trait OrderDictionary
{
//if you comment out this line, everything works, but methodFromMinkTrait is
//unresolved
use MinkDictionary;
public function myMethod($element, $text)
{
//some method that uses methods from MinkDictionary
return $this->methodFromMinkTrait();
}
}
The compilation fails with a Fatal Error:
Fatal error: Trait method setMink has not been applied, because there are collisions with other trait methods on LunchTime\DeliveryBundle\Features\Context\FeatureContext
setMink
method is only defined inMinkDictionary
trait.
The problem is that both OrderDictionary
and FeatureContext
are using methods from MinkDictionary
. That's why I added use MinkDictionary
in OrderDictionary
. Is this not allowed? If you comment that out, then everything works, but the editor is showing a lot of unresolved methods - it doesn't know where they are coming from.