0
votes
  • after running, i am getting Fatal error: Cannot declare class JsonApiContext because the name is already in use in C:\behat\newapi\vendor\features\bootstrap\FeatureContext.php on line 13

can anyone please help me on same ?

Thanks

2
Please provide more information: could you show the code of the involved source files? - Kariem
@Kariem here are my files 'composer.json' prntscr.com/bgl9l1 'behat.yml' prntscr.com/bgl9of 'featurecontext' prntscr.com/bgl9s4 - Jaspreet Singh
Edit the question and include the files, so that everything can be seen in one place. This makes it easier for everyone to see how the elements are linked. - Kariem
@Kariem Composer.json { "require-dev" : { "behat/behat" : "3.0.*", "behat/mink-goutte-driver" : "", "behat/mink-browserkit-driver" : "", "behat/mink-extension" : "2.0.1", "behat/mink-selenium2-driver" : "", "behat/mink" : "", "drupal/drupal-extension": "~3.0", "behat/common-contexts": "*" }, "require" : { "kriswallsmith/buzz" : "~0.14", "kielabokkie/jsonapi-behat-extension": "1.0.*@beta" } } ________________________________________ - Jaspreet Singh
@Kariem My behat.yml is too long and stackoverflow comment doesn't allow me to paste it here. Please suggest - Jaspreet Singh

2 Answers

0
votes

If you change the extends inheritance with a different class do you still get the error message?

Have you tried with "implements" instead of "extends"?

0
votes

You need to use JsonApiContext.

In your FeatureContext.php it shall look like class FeatureContext extends JsonApiContext ....