예제 #1
0
 public function getAuthInstance()
 {
     $dbFactory = new DbFactory();
     $storage = $dbFactory->getSqlStorage(DB_CTCRM);
     $userMapper = new Mapper($storage, 'users');
     $authService = new \Auth($userMapper, array('id' => 'username', 'pw' => 'password'));
     return new Authenticator($authService);
 }
 public static function createTestDatabase()
 {
     try {
         $factory = new Factory();
         $handler = $factory->getDbConnection('testdb');
         $handler->query(readfile(__DIR__ . '_files/create_testdb.sql'));
     } catch (Exception $e) {
         echo $e->getMessage() . PHP_EOL;
     }
 }
예제 #3
0
 /**
  * @group integration
  */
 public function setUp()
 {
     $factory = new Factory();
     $this->handler = $factory->getDbConnection('testdb');
     //        Helper_TestDatabaseCreator::createTestDatabase();
 }
예제 #4
0
 public function getArticleDataService()
 {
     $dbFactory = new Factory();
     $handler = $dbFactory->getDbConnection('ctcrm');
     return new ArticleDataService($handler);
 }
예제 #5
0
 public function testHandlerIsReturnedWhenTestDbIsRequested()
 {
     $this->assertInstanceOf('ctcrm\\database\\Handler', $this->factory->getDbConnection($this->testSetup['database']));
 }