See Documentation for testing
Inheritance: extends Page
コード例 #1
0
ファイル: model1.php プロジェクト: atk4/atk4-tests
 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
ファイル: validator2.php プロジェクト: atk4/atk4-tests
 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
ファイル: model2.php プロジェクト: atk4/atk4-tests
 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
ファイル: modelrefref.php プロジェクト: atk4/atk4-tests
 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
ファイル: deepref.php プロジェクト: atk4/atk4-tests
 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
ファイル: session.php プロジェクト: atk4/atk4-tests
 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
ファイル: modeldef.php プロジェクト: TigerBui/atk4
 function init()
 {
     $this->db = $this->add('DB');
     parent::init();
 }