Пример #1
0
 protected function setUp()
 {
     parent::setUp();
     $this->connection = DriverManager::getConnection(['driver' => 'pdo_sqlite', 'path' => self::SQLITE_PATH], new Configuration());
     $config = Setup::createAnnotationMetadataConfiguration([__DIR__ . '/../..'], true);
     $this->entityManager = EntityManager::create($this->connection, $config);
 }
Пример #2
0
 protected function setUp()
 {
     parent::setUp();
     $configured = ConnectionManager::configured();
     if (empty($configured)) {
         ConnectionManager::config('default', ['className' => 'Cake\\Database\\Connection', 'driver' => 'Cake\\Database\\Driver\\Sqlite', 'database' => self::SQLITE_PATH]);
     }
     $this->Posts = TableRegistry::get('Posts');
 }