contexts icon indicating copy to clipboard operation
contexts copied to clipboard

Add assertNull method.

Open Gregoire-M opened this issue 4 years ago • 0 comments

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.

Gregoire-M avatar Mar 31 '21 13:03 Gregoire-M