Behatch / contexts

Behat extension with most custom helper steps
Other
394 stars 203 forks source link

Add assertNull method. #299

Closed Gregoire-M closed 1 year ago

Gregoire-M commented 3 years ago

I have a Behat context that extends Behatch\Context\BaseContext, so I usually use asserters available in the Behatch\Asserter trait to simplify my context code.

Today I wanted to assert that a value is null, so I do this:

$this->assertEquals(null, $user->getSignature());

Php CS Fixer sees that, thinks it's a PhpUnit test, and changes it to:

$this->assertNull($user->getSignature());

But of course, then I get this error:

Fatal error: Call to undefined method App\Tests\Behat\Context\UserContext::assertNull()

So I propose to add this useful method.