for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Behat\Behat\Context\Environment\InitializedContextEnvironment;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
use Behat\MinkExtension\Context\RawMinkContext;
class AuthContext extends RawMinkContext
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
/**
* @var MinkContext
*/
private $minkContext;
* @BeforeScenario
* @param BeforeScenarioScope $scope
public function gatherContexts(BeforeScenarioScope $scope)
/** @var InitializedContextEnvironment $environment */
$environment = $scope->getEnvironment();
$this->minkContext = $environment->getContext(MinkContext::class);
}
* @Given /^I login as admin$/
public function iLoginAsAdmin()
$this->minkContext->visit('/admin/login');
$this->minkContext->fillField('username or email', 'admin');
$this->minkContext->fillField('password', 'admin');
$this->minkContext->pressButton('Log in');
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.