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(); }
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(); } }
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(); }
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(); }
function init() { parent::init(); $this->skipTests('Not ready'); }
function init() { $this->myapp = $this->add('ApiCLI'); return parent::init(); }
function init() { $this->api->pm->base_path = '/'; parent::init(); // for consistent test results }
function init() { $this->i = $this->add('MyInvisible'); parent::init(); $this->i->destroy(); }
function init() { $this->c = $this->add('Controller_Data_Session'); parent::init(); }
function init() { parent::init(); $this->api->getConfig('foo'); }
function init() { $this->db = $this->add('DB'); parent::init(); }