a tiny mvc framework for php using php-activerecord
1<?php
2include 'helpers/config.php';
3require_once __DIR__ . '/../lib/adapters/OciAdapter.php';
4
5class OciAdapterTest extends AdapterTest
6{
7 public function set_up($connection_name=null)
8 {
9 parent::set_up('oci');
10 }
11
12 public function test_get_sequence_name()
13 {
14 $this->assert_equals('authors_seq',$this->conn->get_sequence_name('authors','author_id'));
15 }
16
17 public function test_columns_text()
18 {
19 $author_columns = $this->conn->columns('authors');
20 $this->assert_equals('varchar2',$author_columns['some_text']->raw_type);
21 $this->assert_equals(100,$author_columns['some_text']->length);
22 }
23
24 public function test_datetime_to_string()
25 {
26 $this->assert_equals('01-Jan-2009 01:01:01 AM',$this->conn->datetime_to_string(date_create('2009-01-01 01:01:01 EST')));
27 }
28
29 public function test_date_to_string()
30 {
31 $this->assert_equals('01-Jan-2009',$this->conn->date_to_string(date_create('2009-01-01 01:01:01 EST')));
32 }
33
34 public function test_insert_id() {}
35 public function test_insert_id_with_params() {}
36 public function test_insert_id_should_return_explicitly_inserted_id() {}
37 public function test_columns_time() {}
38 public function test_columns_sequence() {}
39
40 public function test_set_charset()
41 {
42 $connection_string = ActiveRecord\Config::instance()->get_connection($this->connection_name);
43 $conn = ActiveRecord\Connection::instance($connection_string . '?charset=utf8');
44 $this->assert_equals(';charset=utf8', $conn->dsn_params);
45 }
46}
47?>