]> src.bluestatic.org Git - isso.git/blob - UnitTest/DatabaseMySQLTest.php
Renaming all the classes for the Printer to match the name of the file
[isso.git] / UnitTest / DatabaseMySQLTest.php
1 <?php
2
3 require_once 'PHPUnit/Framework.php';
4 require_once 'DatabaseTestAbstract.php';
5
6 class DatabaseMySQLTest extends DatabaseTestAbstract
7 {
8 public function setUp()
9 {
10 require_once 'tests.config.php';
11 require_once ISSO . '/App.php';
12
13 $this->fixture = new BSDbMySql();
14 $this->fixture->connect(TEST_DB_MYSQL_HOST, TEST_DB_MYSQL_USER, TEST_DB_MYSQL_PASSWORD, TEST_DB_MYSQL_DATABASE);
15 $this->fixture->query("
16 CREATE TABLE test
17 (
18 id int auto_increment,
19 textstuff varchar(255),
20 PRIMARY KEY (id)
21 ) ENGINE=InnoDb
22 ");
23 }
24
25 public function tearDown()
26 {
27 $this->fixture->query("DROP TABLE test");
28 $this->fixture = null;
29 }
30
31 public function testConnect()
32 {
33 try
34 {
35 $test = new BSDbMySql();
36 $test->connect('localhost', '--invalid user--', '--invalid password--', '--nodatabase--');
37 $this->fail('exception expected');
38 }
39 catch (BSDbException $e)
40 {}
41 }
42 }
43
44 ?>