Deprecated: Assigning the return value of new by reference is deprecated in /home/bluestat/public_html/source/index.php on line 477
ISSO - Blob - ViewGit - Blue Static
<?php

require_once 'PHPUnit/Framework.php';
require_once 'DatabaseTestAbstract.php';

class DatabaseMySQLTest extends DatabaseTestAbstract
{
	public function setUp()
	{
		require_once 'tests.config.php';
		require_once ISSO . '/App.php';

		$this->fixture = new BSDbMySql();
		$this->fixture->connect(TEST_DB_MYSQL_HOST, TEST_DB_MYSQL_USER, TEST_DB_MYSQL_PASSWORD, TEST_DB_MYSQL_DATABASE);
		$this->fixture->query("
			CREATE TABLE test
			(
				id int auto_increment,
				textstuff varchar(255),
				PRIMARY KEY (id)
			) ENGINE=InnoDb
		");
	}

	public function tearDown()
	{
		$this->fixture->query("DROP TABLE test");
		$this->fixture = null;
	}

	public function testConnect()
	{
		try
		{
			$test = new BSDbMySql();
			$test->connect('localhost', '--invalid user--', '--invalid password--', '--nodatabase--');
			$this->fail('exception expected');
		}
		catch (BSDbException $e)
		{}
	}
}

?>