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