See Documentation for testing
Inheritance: extends Page
示例#1
0
 function init()
 {
     $this->db = $this->add('DB');
     try {
         $this->db->query('drop table author');
     } catch (PDOException $e) {
     }
     try {
         $this->db->query('drop table book');
     } catch (PDOException $e) {
     }
     try {
         $this->db->query('drop table contact');
     } catch (PDOException $e) {
     }
     $this->db->query('create table author (id int not null primary key auto_increment, name varchar(255), email varchar(255),my_contact int)');
     $this->db->query('create table book (id int not null primary key auto_increment, name varchar(255), isbn varchar(255), author_id int)');
     $this->db->query('create table contact (id int not null primary key auto_increment, address varchar(255), line1 varchar(255), street varchar(255), author_id int)');
     $this->api->pathfinder->addLocation('..', array('addons' => 'atk4-addons'));
     $this->a = $a = $this->add($this->author_class);
     $this->a->deleteAll();
     $a = $this->a;
     if ($a->hasMethod('addCache')) {
         $c = $a->addCache('Dumper', 'zz');
         $c->setPrimarySource($a, 'Array');
     }
     $n = array('Anne', 'Jane', 'Aileen', 'John', 'Peter', 'Gavin', 'David', 'Marin', 'Skuja');
     $s = array('Smith', 'Blogs', 'Coder', 'Tester', 'Hacker');
     for ($x = 0; $x < 100; $x++) {
         $a['name'] = $this->r($n) . ' ' . $this->r($s);
         $a->saveAndUnload();
     }
     parent::init();
 }
示例#2
0
 function executeTest($test_obj, $test_func, $input)
 {
     try {
         return parent::executeTest($test_obj, $test_func, $input);
     } catch (Exception_ValidityCheck $e) {
         return $e->getField() . ': ' . $e->getMessage();
     }
 }
示例#3
0
 function init()
 {
     $this->db = $this->add('DB');
     try {
         $this->db->query('drop table author');
     } catch (PDOException $e) {
     }
     try {
         $this->db->query('drop table book');
     } catch (PDOException $e) {
     }
     try {
         $this->db->query('drop table contact');
     } catch (PDOException $e) {
     }
     $this->db->query('create table author (id int not null primary key auto_increment, name varchar(255), email varchar(255),my_contact int)');
     $this->db->query('create table book (id int not null primary key auto_increment, deleted char(1), name varchar(255), isbn varchar(255), author_id int)');
     $this->db->query('create table contact (id int not null primary key auto_increment, address varchar(255), author_id int)');
     $this->api->pathfinder->addLocation('..', array('addons' => 'atk4-addons'));
     parent::init();
 }
示例#4
0
 function init()
 {
     $this->db = $this->add('DB');
     try {
         $this->db->query('drop table user_m');
     } catch (PDOException $e) {
     }
     try {
         $this->db->query('drop table item');
     } catch (PDOException $e) {
     }
     try {
         $this->db->query('drop table purchase');
     } catch (PDOException $e) {
     }
     $this->db->query('create table user_m (id int not null primary key auto_increment, email varchar(255))');
     $this->db->query('create table item (id int not null primary key auto_increment, name varchar(255), price int)');
     $this->db->query('create table purchase (id int not null primary key auto_increment, user_id int, item_id int, `date` datetime)');
     $this->api->pathfinder->addLocation('..', array('addons' => 'atk4-addons'));
     parent::init();
 }
示例#5
0
 function init()
 {
     parent::init();
     $this->skipTests('Not ready');
 }
示例#6
0
文件: auth.php 项目: TigerBui/atk4
 function init()
 {
     $this->myapp = $this->add('ApiCLI');
     return parent::init();
 }
示例#7
0
文件: url.php 项目: atk4/atk4-tests
 function init()
 {
     $this->api->pm->base_path = '/';
     parent::init();
     // for consistent test results
 }
示例#8
0
文件: view.php 项目: TigerBui/atk4
 function init()
 {
     $this->i = $this->add('MyInvisible');
     parent::init();
     $this->i->destroy();
 }
示例#9
0
 function init()
 {
     $this->c = $this->add('Controller_Data_Session');
     parent::init();
 }
示例#10
0
文件: tmail.php 项目: atk4/atk4-tests
 function init()
 {
     parent::init();
     $this->api->getConfig('foo');
 }
示例#11
0
 function init()
 {
     $this->db = $this->add('DB');
     parent::init();
 }