miniflux-legacy/tests/functional/BaseApiTest.php

20 lines
560 B
PHP
Raw Normal View History

2016-12-29 21:45:09 +01:00
<?php
require_once __DIR__.'/../../app/common.php';
abstract class BaseApiTest extends PHPUnit_Framework_TestCase
{
protected $adminUser = array();
public function setUp()
{
if (DB_DRIVER === 'postgres') {
$pdo = new PDO('pgsql:host='.DB_HOSTNAME, DB_USERNAME, DB_PASSWORD);
$pdo->exec('CREATE DATABASE '.DB_NAME.' WITH OWNER '.DB_USERNAME);
}
$db = Miniflux\Database\get_connection();
$this->adminUser = $db->table(Miniflux\Model\User\TABLE)->eq('username', 'admin')->findOne();
}
}