public function loadFactories($paths) { foreach ((array) $paths as $path) { $real = realpath($path); if (!$real) { throw new DirectoryNotFoundException($path); } if (!is_dir($real)) { throw new DirectoryNotFoundException($real); } $this->loadDirectory($real); } return $this; }
public function _beforeSuite($settings = []) { $store = null; if ($this->ormModule instanceof DataMapper) { // for Doctrine $store = new RepositoryStore($this->ormModule->_getEntityManager()); } $this->factoryMuffin = new FactoryMuffin($store); if ($this->config['factories']) { foreach ((array) $this->config['factories'] as $factoryPath) { $realpath = realpath(codecept_root_dir() . $factoryPath); if ($realpath === false) { throw new ModuleException($this, 'The path to one of your factories is not correct. Please specify the directory relative to the codeception.yml file (ie. _support/factories).'); } $this->factoryMuffin->loadFactories($realpath); } } }