Пример #1
0
 public function setUp()
 {
     $dataPath = realpath(__DIR__ . '/../..');
     $this->config = parse_ini_file($dataPath . '/data/entities.csv.ini', true);
     $this->connection = new CsvDataGateway($this->config['dataPath']);
     $this->transactor = new CsvTransactor($this->connection);
     parent::setUp();
     $dataMapper = new CsvDataMapper($this->connection, Article::class, 'articles', $this->entityRegistry);
     $this->repo = new Repository(Article::class, $dataMapper, $this->unitOfWork);
 }
 public function setUp()
 {
     $dataPath = realpath(__DIR__ . '/../..');
     $this->config = parse_ini_file($dataPath . '/data/entities.doctrine.ini', true);
     $this->connection = DriverManager::getConnection(['url' => $this->config['databaseUrl']]);
     $this->transactor = new DoctrineTransactor($this->connection);
     parent::setUp();
     $dataMapper = new DoctrineDataMapper($this->connection, Article::class, 'articles', $this->entityRegistry);
     $this->repo = new Repository(Article::class, $dataMapper, $this->unitOfWork);
 }