Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AfterSuiteTested vs AfterSuiteAborted #63

Open
aronbeal opened this issue Mar 11, 2016 · 3 comments
Open

AfterSuiteTested vs AfterSuiteAborted #63

aronbeal opened this issue Mar 11, 2016 · 3 comments

Comments

@aronbeal
Copy link

In throwing an exception within my Behat Step definition, I correctly fail a given behat test. However, before the command returns, I get the following:

Recoverable fatal error: Argument 1 passed to emuse\BehatHTMLFormatter\Formatter\BehatHTMLFormatter::onAfterSuiteTested() must be an instance of Behat\Testwork\EventDispatcher\Event\AfterSuiteTested, instance of Behat\Testwork\EventDispatcher\Event\AfterSuiteAborted given in emuse\BehatHTMLFormatter\Formatter\BehatHTMLFormatter->onAfterSuiteTested() (line 474 of [excluded]/vendor/emuse/behat-html-formatter/src/Formatter/BehatHTMLFormatter.php).

I was able to resolve this issue (and a subsequent one) by changing

public function onAfterSuiteTested(AfterSuiteTested $event)
and
public function onAfterExercise(AfterExerciseCompleted $event)

to

public function onAfterSuiteTested(\Behat\Testwork\EventDispatcher\Event\SuiteTested $event)
and
public function onAfterExercise(\Behat\Testwork\EventDispatcher\Event\ExerciseCompleted $event)

Is there a reason you're using the specific classes rather than the interfaces here?

@pharman
Copy link

pharman commented Mar 31, 2016

I've forked this repo until the above can be fixed

@kenorb
Copy link

kenorb commented Aug 31, 2017

Same error here after tests are run:

TypeError: Argument 1 passed to emuse\BehatHTMLFormatter\Formatter\BehatHTMLFormatter::onAfterSuiteTested() must be an instance of Behat\Testwork\EventDispatcher\Event\AfterSuiteTested, instance of Behat\Testwork\EventDispatcher\Event\AfterSuiteAborted given in emuse\BehatHTMLFormatter\Formatter\BehatHTMLFormatter->onAfterSuiteTested() (line 416 of vendor/emuse/behat-html-formatter/src/Formatter/BehatHTMLFormatter.php).

Affected file: BehatHTMLFormatter.php.

@r4cker
Copy link

r4cker commented May 20, 2023

I had the same issue because I used the folowing commande line

bin/behat --strict --stop-on-failure

I you remove --stop-on-failure it should works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants