<?php

/**
 * Generated by PHPUnit_SkeletonGenerator on 2015-07-30 at 14:52:14.
 */
class DBServiceTest extends PHPUnit_Framework_TestCase {

    /**
     * @var DBService
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp() {
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown() {

    }

    public function testConnection() {
        try {
            $dbservice = new DBService();
        } catch (RuntimeException $exception) {
            $this->fail($exception->getMessage());
        }

        return $dbservice;
    }

    /**
     * @depends testConnection
     * @covers DBService::selectDB
     */
    public function testSelectDB($dbservice) {
        try {
            $dbservice->selectDB(Config::$database->usageDatabaseName);
        } catch (RuntimeException $exception) {
            $this->fail($exception->getMessage());
        }

        return $dbservice;
    }

    /**
     * @depends testConnection
     * @expectedException RuntimeException
     */
    public function testEmptyQuery($dbservice) {
        $dbservice->query("");
    }

    /**
     * @covers DBService::getDatabase
     * @todo   Implement testGetDatabase().
     */
    public function testGetDatabase() {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers DBService::query
     * @todo   Implement testQuery().
     */
    public function testQuery() {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

    /**
     * @covers DBService::escapeString
     * @todo   Implement testEscapeString().
     */
    public function testEscapeString() {
        // Remove the following lines when you implement this test.
        $this->markTestIncomplete(
            'This test has not been implemented yet.'
        );
    }

}
