/** * Initializes context. * * Every scenario gets its own context instance. * You can also pass arbitrary arguments to the * context constructor through behat.yml. */ public function __construct() { $emailAddressFinderFactory = new EmailAddressFinderFactory(); $this->emailAddressFinder = $emailAddressFinderFactory->create(); $numberFinderFactory = new NumberFinderFactory(); $this->numberFinder = $numberFinderFactory->create(); $hostnameFinderFactory = new HostnameFinderFactory(); $this->hostnameFinder = $hostnameFinderFactory->create(); $abbreviationFinderFactory = new AbbreviationFinderFactory(); $this->abbreviationFinder = $abbreviationFinderFactory->create(); $urlFinderFactory = new UrlFinderFactory(); $this->urlFinder = $urlFinderFactory->create(); }
public function __construct(array $abbreviations = array()) { $factory = new AbbreviationFinderFactory(); $factory->addAbbreviations($abbreviations); $this->abbreviationFinder = $factory->create(); }