示例#1
0
 public function setUp()
 {
     parent::setUp();
     $this->_tableName = 'dbexport' . uniqid();
     $this->_model = new Kwf_Model_DbWithConnection_ImportExport_Model(array("table" => $this->_tableName));
     $this->_model->writeInitRows();
 }
示例#2
0
 public function setUp()
 {
     parent::setUp();
     $this->_client = $this->getMock('Kwf_Srpc_Client', array('rowSave', 'rowDelete', 'getPrimaryKey', 'getColumns'), array(array('serverUrl' => 'invalid' . uniqid())), '', true);
     $this->_client->expects($this->any())->method('getColumns')->will($this->returnValue(array('id', 'firstname', 'lastname')));
     $this->_client->expects($this->any())->method('getPrimaryKey')->will($this->returnValue('id'));
 }
示例#3
0
 public function setUp()
 {
     parent::setUp();
     $select = new Kwf_Model_Select();
     $select->whereEquals('active', 1);
     $this->_model = new Kwf_Model_Union(array('models' => array('a' => 'Kwf_Model_Union_MergeSelect_Model1', 'b' => array('model' => 'Kwf_Model_Union_MergeSelect_Model2', 'select' => $select)), 'columnMapping' => 'Kwf_Model_Union_MergeSelect_TestMapping'));
 }
 public function setUp()
 {
     parent::setUp();
     $this->_sourceModel = new Kwf_Model_FnF(array('uniqueIdentifier' => 'unique', 'columns' => array('id', 'firstname', 'lastname', 'timefield'), 'uniqueColumns' => array('id'), 'data' => array(array('id' => 1, 'firstname' => 'Max', 'timefield' => '2008-06-09 00:00:00'), array('id' => 2, 'firstname' => 'Susi', 'timefield' => '2008-07-09 10:00:00'), array('id' => 3, 'firstname' => 'Kurt', 'timefield' => '2008-07-15 20:00:00'))));
     $this->_mirrorModel = new Kwf_Model_FnF(array('uniqueIdentifier' => 'unique', 'columns' => array('id', 'firstname', 'lastname', 'timefield'), 'uniqueColumns' => array('id'), 'data' => array(array('id' => 1, 'firstname' => 'Max', 'timefield' => '2008-06-09 00:00:00'), array('id' => 2, 'firstname' => 'Susi', 'timefield' => '2008-07-09 10:00:00'))));
     $this->_proxyModel = new Kwf_Model_MirrorCache(array('proxyModel' => $this->_mirrorModel, 'sourceModel' => $this->_sourceModel, 'syncTimeField' => 'timefield', 'maxSyncDelay' => 0));
 }
 public function setUp()
 {
     parent::setUp();
     $this->_sourceModel = new Kwf_Model_FnF(array('uniqueIdentifier' => 'unique', 'columns' => array('id', 'firstname', 'lastname', 'timefield'), 'uniqueColumns' => array('id'), 'data' => array(array('id' => 1, 'firstname' => 'Max', 'timefield' => '2008-06-09 00:00:00'), array('id' => 2, 'firstname' => 'Susi', 'timefield' => '2008-07-09 10:00:00'), array('id' => 3, 'firstname' => 'Kurt', 'timefield' => '2008-07-15 20:00:00'))));
     $this->_mirrorModel = new Kwf_Model_FnF(array('uniqueIdentifier' => 'unique', 'columns' => array('id', 'firstname', 'lastname', 'timefield'), 'uniqueColumns' => array('id'), 'data' => array(array('id' => 1, 'firstname' => 'Max', 'timefield' => '2008-06-09 00:00:00'), array('id' => 2, 'firstname' => 'Susi', 'timefield' => '2008-07-09 10:00:00'))));
     $this->_proxyModel = $this->_getNewModel();
 }
示例#6
0
 public function setUp()
 {
     $this->_db = $this->getMock('Kwf_Model_Db_TestAdapter', array('fetchCol', 'query'));
     $this->_db->expects($this->once())->method('fetchCol')->with($this->equalTo('SHOW TABLES'))->will($this->returnValue(array('foo', 'bar', 'bam')));
     $this->_model = new Kwf_Db_TablesModel(array('db' => $this->_db));
     parent::setUp();
 }
示例#7
0
 public function tearDown()
 {
     parent::tearDown();
     Kwf_Model_Abstract::getInstance('Kwf_Model_Union_Dependent_Parent')->dropTable();
     Kwf_Model_Abstract::getInstance('Kwf_Model_Union_Dependent_Model1')->dropTable();
     Kwf_Model_Abstract::getInstance('Kwf_Model_Union_Dependent_Model2')->dropTable();
 }
示例#8
0
 public function setUp()
 {
     parent::setUp();
     $this->_m = Kwf_Model_Abstract::getInstance('Kwf_User_AuthAutoLogin_FnF');
     $row = $this->_m->getRow(1);
     $row->autologin = '******';
     $row->save();
 }
示例#9
0
 public function setUp()
 {
     parent::setUp();
     Kwf_Model_Events_UnionReFire_EventSubscriber::$onUnionRowUpdatedCalled = array();
     Kwf_Model_Events_UnionReFire_EventSubscriber::$onSourceRowUpdatedCalled = array();
     Kwf_Events_Dispatcher::addListeners('Kwf_Model_Events_UnionReFire_UnionModel');
     Kwf_Events_Dispatcher::addListeners(Kwf_Events_Subscriber::getInstance('Kwf_Model_Events_UnionReFire_EventSubscriber'));
 }
示例#10
0
 public function setUp()
 {
     parent::setUp();
     Kwf_Model_Events_ProxySourceNoClass_EventSubscriber::$onProxyRowInsertedCalled = 0;
     Kwf_Model_Events_ProxySourceNoClass_EventSubscriber::$onProxyModelUpdatedCalled = 0;
     Kwf_Events_Dispatcher::addListeners('Kwf_Model_Events_ProxySourceNoClass_Model');
     Kwf_Events_Dispatcher::addListeners(Kwf_Events_Subscriber::getInstance('Kwf_Model_Events_ProxySourceNoClass_EventSubscriber'));
 }
示例#11
0
 public function setUp()
 {
     parent::setUp();
     Kwf_Assets_Filter_GeneralDepFilter_Dependency1::$contents = 'body { color: $red; }';
     Kwf_Assets_Filter_GeneralDepFilter_Dependency1::$mtime = time() - 1;
     Kwf_Assets_Filter_GeneralDepFilter_Dependency2::$contents = 'p { color: blue; }';
     Kwf_Assets_Filter_GeneralDepFilter_Dependency2::$mtime = time();
 }
示例#12
0
 public function setUp()
 {
     parent::setUp();
     Kwf_Model_Abstract::getInstance('Kwf_Form_MultiFields_TestModel1')->setData(array(array('id' => 1, 'blub' => 'blub0'), array('id' => 2, 'blub' => 'blub1'), array('id' => 3, 'blub' => 'blub2')));
     Kwf_Model_Abstract::getInstance('Kwf_Form_MultiFields_TestModel2')->setData(array(array('id' => 1, 'model1_id' => 1, 'foo' => 'foo0', 'bar' => 'bar0', 'pos' => 1), array('id' => 2, 'model1_id' => 1, 'foo' => 'foo1', 'bar' => 'bar1', 'pos' => 2), array('id' => 3, 'model1_id' => 2, 'foo' => 'foo2', 'bar' => 'bar2', 'pos' => 1), array('id' => 4, 'model1_id' => 3, 'foo' => 'foo0', 'pos' => 1), array('id' => 5, 'model1_id' => 3, 'foo' => 'foo1', 'pos' => 2), array('id' => 6, 'model1_id' => 3, 'foo' => 'foo2', 'pos' => 3)));
     Kwf_Component_Data_Root::setComponentClass(false);
     //damit ModelObserver nichts macht
 }
 public function setUp()
 {
     $this->_parser = new Kwc_Basic_Text_Parser('', null);
     $this->_parser->setMasterStyles(array(array('tagName' => 'h1', 'className' => 'fooTest', 'name' => 'Foo Style'), array('tagName' => 'span', 'className' => 'fooTest2', 'name' => 'Bar Style')));
     $this->_parser->setEnableTagsWhitelist(true);
     $this->_parser->setEnableStyles(true);
     parent::setUp();
 }
示例#14
0
 public function setUp($componentClass = null)
 {
     parent::setUp();
     if ($componentClass) {
         $this->_init($componentClass);
     }
     Kwf_Component_Data_Root::setShowInvisible(false);
 }
示例#15
0
 public function setUp()
 {
     parent::setUp();
     $this->_table = $this->getMock('Kwf_Model_Db_Table', array('select', '_setupMetadata', '_setupPrimaryKey', '_fetch', 'insert'), array('db' => new Kwf_Model_Db_TestAdapter()), '', true);
     $this->_dbSelect = $this->getMock('Kwf_Db_Table_Select', array(), array($this->_table));
     $this->_table->expects($this->any())->method('select')->will($this->returnValue($this->_dbSelect));
     $this->_model = new Kwf_Model_Db(array('table' => $this->_table));
 }
示例#16
0
 public function setUp()
 {
     apc_clear_cache('user');
     Kwf_Cache::factory('Core', 'Memcached', array('lifetime' => null, 'automatic_cleaning_factor' => false, 'automatic_serialization' => true))->clean();
     Kwf_Cache_Simple::resetZendCache();
     parent::setUp();
     Kwf_Events_Dispatcher::addListeners('Kwf_Model_RowCache_RowCacheModel');
     Kwf_Model_Abstract::getInstance('Kwf_Model_RowCache_SourceModel')->setData(array(array('id' => 1, 'foo' => 1, 'bar' => 'x1'), array('id' => 2, 'foo' => 2, 'bar' => 'x2'), array('id' => 3, 'foo' => 3, 'bar' => 'x3'), array('id' => 4, 'foo' => 4, 'bar' => 'x4')));
 }
示例#17
0
 public function setUp()
 {
     parent::setUp();
     if (!Kwf_Registry::get('config')->amazon || !Kwf_Registry::get('config')->amazon->key) {
         $this->markTestSkipped();
     }
     sleep(1);
     Kwf_Model_Abstract::clearInstances();
 }
示例#18
0
 public function setUp()
 {
     parent::setUp();
     $this->_db = $this->getMock('Kwf_Model_Db_TestAdapter', array('query'));
     $this->_table = $this->getMock('Kwf_Model_Db_DbSibling_MasterTable', array('select', '_setupMetadata', '_setupPrimaryKey'), array('db' => $this->_db), '', true);
     $this->_dbSelect = $this->getMock('Kwf_Db_Table_Select', array(), array($this->_table));
     $this->_table->expects($this->any())->method('select')->will($this->returnValue($this->_dbSelect));
     $this->_model = new Kwf_Model_Db_DbSibling_MasterModel(array('table' => $this->_table));
     $this->_stmt = $this->getMock('Zend_Db_Statement', array('fetchAll', 'closeCursor', 'columnCount', 'errorCode', 'errorInfo', 'fetch', 'nextRowset', 'rowCount'), array($this->_db, ''), '', false);
 }
示例#19
0
 public function setUp()
 {
     parent::setUp();
     $m1 = new Kwf_Model_FnF();
     $form = new Kwf_Form();
     $form->setModel($m1);
     $fs = $form->add(new Kwf_Form_Container_FieldSet('fs'))->setCheckboxToggle(true)->setCheckboxName('fs');
     $fs->add(new Kwf_Form_Field_TextField('text'))->setAllowBlank(false);
     $this->_form = $form;
 }
 public function setUp()
 {
     parent::setUp();
     $this->_uploadsModel = Kwf_Model_Abstract::getInstance('Kwf_Form_File_UploadsTestModel');
     $this->_model = new Kwf_Model_FnF(array('referenceMap' => array('File' => array('refModelClass' => 'Kwf_Form_File_UploadsTestModel', 'column' => 'upload_id')), 'data' => array()));
     $fRow = $this->_uploadsModel->createRow()->writeFile('asdf', 'foo', 'txt', 'text/plain');
     $this->_uploadId1 = $fRow->id;
     $r = $this->_uploadsModel->createRow()->writeFile('asdf1', 'foo1', 'txt', 'text/plain');
     $this->_uploadId2 = $r->id;
     $this->_row = $this->_model->createRow();
     $this->_row->upload_id = $fRow->id;
     $this->_row->save();
     $this->_field = new Kwf_Form_Field_File('File');
 }
 public function setUp()
 {
     parent::setUp();
     $this->_list = new Kwf_Assets_Dependency_TestProviderList();
 }
示例#22
0
 public function tearDown()
 {
     Kwf_Model_Abstract::getInstance('Kwf_Model_DbWithConnection_SiblingRelationExpr_TestModel')->dropTable();
     Kwf_Model_Abstract::getInstance('Kwf_Model_DbWithConnection_SiblingRelationExpr_RelationModel')->dropTable();
     parent::tearDown();
 }
示例#23
0
 public function setUp()
 {
     parent::setUp();
     $this->_m = Kwf_Model_Abstract::getInstance('Kwf_User_AuthPassword_FnF');
 }
 public function setUp()
 {
     parent::setUp();
     $this->_table = $this->getMock('Kwf_Model_Db_Table', array('_setupMetadata', '_setupPrimaryKey'), array('db' => new Kwf_Model_Db_TestAdapter()), '', true);
     $this->_model = new Kwf_Model_Db(array('table' => $this->_table));
 }
示例#25
0
 public function setUp()
 {
     parent::setUp();
     $this->_list = new Kwf_Assets_CommonJs_TestProviderList();
     $this->_package = new Kwf_Assets_Package($this->_list, 'A');
 }
示例#26
0
 public function setUp()
 {
     parent::setUp();
     Kwf_Assets_Filter_GeneralPackageFilter_Dependency::$contents = 'body { color: $red; }';
     Kwf_Assets_Filter_GeneralPackageFilter_Dependency::$mtime = time() - 1;
 }
示例#27
0
 public function tearDown()
 {
     parent::tearDown();
     Kwf_Model_Abstract::getInstance('Kwf_Model_DbWithConnection_ExprGroupConcat_Model')->dropTable();
     Kwf_Model_Abstract::getInstance('Kwf_Model_DbWithConnection_ExprGroupConcat_ChildModel')->dropTable();
 }
示例#28
0
 public function tearDown()
 {
     Kwf_Registry::get('db')->query("DROP TABLE {$this->_tableName}");
     parent::tearDown();
 }
 public function setUp()
 {
     parent::setUp();
     $this->_jsLoader = new Kwf_Trl_JsLoader();
 }
 public function setUp()
 {
     parent::setUp();
     $this->_model = new Kwf_Model_FnF_SiblingMasterModel();
     Kwf_Model_Abstract::getInstance('Kwf_Model_FnF_SiblingModel')->setData(array(array('master_id' => 1, 'bar' => 'bar1'), array('master_id' => 2, 'bar' => 'bar2'), array('master_id' => 3, 'bar' => 'bar3'), array('master_id' => 100, 'bar' => 'bar3')));
 }