From e306989c6d03aac37e2557465b4812ea21970065 Mon Sep 17 00:00:00 2001 From: wei <> Date: Wed, 24 Jan 2007 05:52:22 +0000 Subject: Fixed #517, #519, #521 --- .gitattributes | 4 +++ .../protected/pages/Advanced/Samples/I18N/Home.php | 5 ++-- .../pages/Advanced/Samples/I18N/config.xml | 4 +-- .../protected/pages/Database/ActiveRecord.page | 18 +++++++++++++ .../Data/ActiveRecord/Exceptions/messages.txt | 3 ++- framework/Data/ActiveRecord/TActiveRecord.php | 30 +++++++++++++++++++--- framework/Web/Javascripts/js/compressed/ajax.js | 3 ++- framework/Web/Javascripts/js/compressed/prado.js | 10 +++++--- .../Web/Javascripts/js/compressed/validator.js | 8 +++--- framework/Web/Javascripts/js/debug/ajax.js | 7 +++-- framework/Web/Javascripts/js/debug/prado.js | 14 +++++++--- framework/Web/Javascripts/js/debug/validator.js | 18 ++++++++----- framework/Web/Javascripts/prado/activecontrols3.js | 7 +++-- framework/Web/Javascripts/prado/controls.js | 14 +++++++--- framework/Web/Javascripts/prado/validation3.js | 18 ++++++++----- .../Web/UI/ActiveControls/TActivePageAdapter.php | 5 ++-- .../tickets/protected/pages/Ticket518.page | 10 ++++++++ .../tickets/protected/pages/Ticket521.page | 12 +++++++++ .../tickets/protected/pages/Ticket521.php | 16 ++++++++++++ .../tickets/tests/Ticket521TestCase.php | 20 +++++++++++++++ .../ActiveRecordDynamicCallTestCase.php | 15 +++++++++-- 21 files changed, 197 insertions(+), 44 deletions(-) create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket518.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket521.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket521.php create mode 100644 tests/FunctionalTests/tickets/tests/Ticket521TestCase.php diff --git a/.gitattributes b/.gitattributes index 7ed8d620..5c2dc5e1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2313,6 +2313,9 @@ tests/FunctionalTests/tickets/protected/pages/Ticket477.page -text tests/FunctionalTests/tickets/protected/pages/Ticket477.php -text tests/FunctionalTests/tickets/protected/pages/Ticket484.page -text tests/FunctionalTests/tickets/protected/pages/Ticket484.php -text +tests/FunctionalTests/tickets/protected/pages/Ticket518.page -text +tests/FunctionalTests/tickets/protected/pages/Ticket521.page -text +tests/FunctionalTests/tickets/protected/pages/Ticket521.php -text tests/FunctionalTests/tickets/protected/pages/Ticket54.page -text tests/FunctionalTests/tickets/protected/pages/Ticket54Master.php -text tests/FunctionalTests/tickets/protected/pages/Ticket54Master.tpl -text @@ -2341,6 +2344,7 @@ tests/FunctionalTests/tickets/tests/Ticket463TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket470TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket477TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket488TestCase.php -text +tests/FunctionalTests/tickets/tests/Ticket521TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket54TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket72TestCase.php -text tests/FunctionalTests/tickets/tests/Ticket93TestCase.php -text diff --git a/demos/quickstart/protected/pages/Advanced/Samples/I18N/Home.php b/demos/quickstart/protected/pages/Advanced/Samples/I18N/Home.php index d9a261d6..f0d127b9 100644 --- a/demos/quickstart/protected/pages/Advanced/Samples/I18N/Home.php +++ b/demos/quickstart/protected/pages/Advanced/Samples/I18N/Home.php @@ -1,4 +1,4 @@ -Request['lang']; - if(CultureInfo::validCulture($lang)) //only valid lang is permitted + $info = new CultureInfo(); + if($info->validCulture($lang)) //only valid lang is permitted $this->getApplication()->getGlobalization()->setCulture($lang); } diff --git a/demos/quickstart/protected/pages/Advanced/Samples/I18N/config.xml b/demos/quickstart/protected/pages/Advanced/Samples/I18N/config.xml index e6fa03ec..5c80f48b 100644 --- a/demos/quickstart/protected/pages/Advanced/Samples/I18N/config.xml +++ b/demos/quickstart/protected/pages/Advanced/Samples/I18N/config.xml @@ -1,4 +1,4 @@ - + @@ -8,7 +8,7 @@ - + diff --git a/demos/quickstart/protected/pages/Database/ActiveRecord.page b/demos/quickstart/protected/pages/Database/ActiveRecord.page index 0e8b8f7d..59d62495 100644 --- a/demos/quickstart/protected/pages/Database/ActiveRecord.page +++ b/demos/quickstart/protected/pages/Database/ActiveRecord.page @@ -373,6 +373,24 @@ $finder->deleteByPk(array( array($key1,$key2), array($key3,$key4), .. ));

+

deleteAll() and deleteBy*()

+

+To delete by a criteria, use deleteAll($criteria) and deleteBy*() +with similar synatx to findAll($criteria) and findAllBy*() as +described above. +

+ +//delete all records with matching Name +$finder->deleteAll('Name = ?', $name); +$finder->deleteByName($name); + +//delete by username and password +$finder->deleteBy_Username_And_Password($name,$pass); + +

+ + +

Transactions

All Active Record objects contains the property DbConnection that can be used to obtain a transaction object. diff --git a/framework/Data/ActiveRecord/Exceptions/messages.txt b/framework/Data/ActiveRecord/Exceptions/messages.txt index 774c0275..53d8f4e3 100644 --- a/framework/Data/ActiveRecord/Exceptions/messages.txt +++ b/framework/Data/ActiveRecord/Exceptions/messages.txt @@ -12,4 +12,5 @@ ar_mismatch_args_exception = ActiveRecord finder method '{0}' expects {1} pa ar_invalid_tablename_property = ActiveRecord tablename property '{0}::${1}' must be static and not null. ar_value_must_not_be_null = Property '{0}::${2}' must not be null as defined by column '{2}' in table '{1}'. ar_missing_pk_values = Missing primary key values in forming IN(key1, key2, ...) for table '{0}'. -ar_pk_value_count_mismatch = Composite key value count mismatch in forming IN( (key1, key2, ..), (key3, key4, ..)) for table '{0}'. \ No newline at end of file +ar_pk_value_count_mismatch = Composite key value count mismatch in forming IN( (key1, key2, ..), (key3, key4, ..)) for table '{0}'. +ar_must_copy_from_array_or_object = $data in {0}::copyFrom($data) must be an object or an array. \ No newline at end of file diff --git a/framework/Data/ActiveRecord/TActiveRecord.php b/framework/Data/ActiveRecord/TActiveRecord.php index 9272e1b9..9bc74c0f 100644 --- a/framework/Data/ActiveRecord/TActiveRecord.php +++ b/framework/Data/ActiveRecord/TActiveRecord.php @@ -424,7 +424,9 @@ abstract class TActiveRecord extends TComponent * Dynamic find method using parts of method name as search criteria. * Method name starting with "findBy" only returns 1 record. * Method name starting with "findAllBy" returns 0 or more records. - * The condition is taken as part of the method name after "findBy" or "findAllBy". + * Method name starting with "deleteBy" deletes records by the trail criteria. + * The condition is taken as part of the method name after "findBy", "findAllBy" + * or "deleteBy". * * The following are equivalent: * @@ -440,25 +442,47 @@ abstract class TActiveRecord extends TComponent * $finder->findAllByAge($age); * $finder->findAll('Age = ?', $age); * + * + * $finder->deleteAll('Name = ?', $name); + * $finder->deleteByName($name); + * * @return mixed single record if method name starts with "findBy", 0 or more records * if method name starts with "findAllBy" */ public function __call($method,$args) { + $delete =false; if($findOne = substr(strtolower($method),0,6)==='findby') $condition = $method[6]==='_' ? substr($method,7) : substr($method,6); else if(substr(strtolower($method),0,9)==='findallby') $condition = $method[9]==='_' ? substr($method,10) : substr($method,9); + else if($delete = substr(strtolower($method),0,8)==='deleteby') + $condition = $method[8]==='_' ? substr($method,9) : substr($method,8); else return null;//throw new TActiveRecordException('ar_invalid_finder_method',$method); + + $criteria = $this->createCriteriaFromString($method, $condition, $args); + if($delete) + return $this->deleteAll($criteria); + else + return $findOne ? $this->find($criteria) : $this->findAll($criteria); + } + + /** + * @param string __call method name + * @param string criteria conditions + * @param array method arguments + * @return TActiveRecordCriteria criteria created from the method name and its arguments. + */ + private function createCriteriaFromString($method, $condition, $args) + { $fields = array(); foreach(preg_split('/and|_and_/i',$condition) as $field) $fields[] = $field.' = ?'; $args=count($args) === 1 && is_array($args[0]) ? $args[0] : $args; if(count($fields)>count($args)) throw new TActiveRecordException('ar_mismatch_args_exception',$method,count($fields),count($args)); - $criteria = new TActiveRecordCriteria(implode(' AND ',$fields),$args); - return $findOne ? $this->find($criteria) : $this->findAll($criteria); + return new TActiveRecordCriteria(implode(' AND ',$fields),$args); } } ?> \ No newline at end of file diff --git a/framework/Web/Javascripts/js/compressed/ajax.js b/framework/Web/Javascripts/js/compressed/ajax.js index ffc57483..5bf062d9 100644 --- a/framework/Web/Javascripts/js/compressed/ajax.js +++ b/framework/Web/Javascripts/js/compressed/ajax.js @@ -257,7 +257,8 @@ this.timer=setInterval(this.onTimerEvent.bind(this),this.options.Interval*1000); {Prado.WebUI.TTimeTriggeredCallback.timers[timer.options.ID]=timer;},start:function(id) {Prado.WebUI.TTimeTriggeredCallback.timers[id].startTimer();},stop:function(id) {Prado.WebUI.TTimeTriggeredCallback.timers[id].stopTimer();}});Prado.WebUI.ActiveListControl=Base.extend({constructor:function(options) -{this.element=$(options.ID);this.options=options;Event.observe(this.element,"change",this.doCallback.bind(this));},doCallback:function(event) +{this.element=$(options.ID);if(this.element) +{this.options=options;Event.observe(this.element,"change",this.doCallback.bind(this));}},doCallback:function(event) {var request=new Prado.CallbackRequest(this.options.EventTarget,this.options);request.dispatch();Event.stop(event);}});Prado.WebUI.TActiveDropDownList=Prado.WebUI.ActiveListControl;Prado.WebUI.TActiveListBox=Prado.WebUI.ActiveListControl;Prado.WebUI.TEventTriggeredCallback=Base.extend({constructor:function(options) {this.options=options;var element=$(options['ControlID']);if(element) Event.observe(element,this.getEventName(element),this.doCallback.bind(this));},getEventName:function(element) diff --git a/framework/Web/Javascripts/js/compressed/prado.js b/framework/Web/Javascripts/js/compressed/prado.js index e1c566e0..74e19278 100644 --- a/framework/Web/Javascripts/js/compressed/prado.js +++ b/framework/Web/Javascripts/js/compressed/prado.js @@ -346,8 +346,9 @@ elements[i].checked=true;}},checkIndices:function(elements,indices) {new Insertion.After(element,content);},before:function(element,content) {new Insertion.Before(element,content);}} Prado.WebUI=Class.create();Prado.WebUI.PostBackControl=Class.create();Prado.WebUI.PostBackControl.prototype={initialize:function(options) -{this._elementOnClick=null,this.element=$(options.ID);if(this.onInit) -this.onInit(options);},onInit:function(options) +{this._elementOnClick=null,this.element=$(options.ID);if(this.element) +{if(this.onInit) +this.onInit(options);}},onInit:function(options) {if(typeof(this.element.onclick)=="function") {this._elementOnClick=this.element.onclick;this.element.onclick=null;} Event.observe(this.element,"click",this.elementClicked.bindEvent(this,options));},elementClicked:function(event,options) @@ -369,8 +370,9 @@ if(y_input) {y_input.value=y;} else {y_input=INPUT({type:'hidden',name:id+'_y','id':id+'_y',value:y});this.element.parentNode.appendChild(y_input);}}});Prado.WebUI.TRadioButton=Class.extend(Prado.WebUI.PostBackControl);Prado.WebUI.TRadioButton.prototype.onRadioButtonInitialize=Prado.WebUI.TRadioButton.prototype.initialize;Object.extend(Prado.WebUI.TRadioButton.prototype,{initialize:function(options) -{this.element=$(options['ID']);if(!this.element.checked) -this.onRadioButtonInitialize(options);}});Prado.WebUI.TTextBox=Class.extend(Prado.WebUI.PostBackControl,{onInit:function(options) +{this.element=$(options['ID']);if(this.element) +{if(!this.element.checked) +this.onRadioButtonInitialize(options);}}});Prado.WebUI.TTextBox=Class.extend(Prado.WebUI.PostBackControl,{onInit:function(options) {this.options=options;if(options['TextMode']!='MultiLine') Event.observe(this.element,"keydown",this.handleReturnKey.bind(this));if(this.options['AutoPostBack']==true) Event.observe(this.element,"change",Prado.PostBack.bindEvent(this,options));},handleReturnKey:function(e) diff --git a/framework/Web/Javascripts/js/compressed/validator.js b/framework/Web/Javascripts/js/compressed/validator.js index 95081d50..a3b3f1cd 100644 --- a/framework/Web/Javascripts/js/compressed/validator.js +++ b/framework/Web/Javascripts/js/compressed/validator.js @@ -51,8 +51,9 @@ this.groups.push(validator.group);},addSummary:function(summary) {var inGroup=group&&summary.group==group;var noGroup=!group&&!summary.group;if(inGroup||noGroup) summary.updateSummary(validators,refresh);else summary.hideSummary(true);});}};Prado.WebUI.TValidationSummary=Class.create();Prado.WebUI.TValidationSummary.prototype={initialize:function(options) -{this.options=options;this.group=options.ValidationGroup;this.messages=$(options.ID);this.visible=this.messages.style.visibility!="hidden" -this.visible=this.visible&&this.messages.style.display!="none";Prado.Validation.addSummary(options.FormID,this);},updateSummary:function(validators,update) +{this.options=options;this.group=options.ValidationGroup;this.messages=$(options.ID);if(this.messages) +{this.visible=this.messages.style.visibility!="hidden" +this.visible=this.visible&&this.messages.style.display!="none";Prado.Validation.addSummary(options.FormID,this);}},updateSummary:function(validators,update) {if(validators.length<=0) {if(update||this.options.Refresh!=false) {return this.hideSummary(validators);} @@ -86,7 +87,8 @@ this.messages.show();this.visible=true;},formats:function(type) {switch(this.options.DisplayMode) {case"List":output+=messages[i]+"\n";break;case"BulletList":default:output+=" - "+messages[i]+"\n";break;case"SingleParagraph":output+=messages[i]+" ";break;}} return output;}};Prado.WebUI.TBaseValidator=Class.create();Prado.WebUI.TBaseValidator.prototype={initialize:function(options) -{this.enabled=true;this.visible=false;this.isValid=true;this._isObserving={};this.group=null;this.requestDispatched=false;this.options=options;this.control=$(options.ControlToValidate);this.message=$(options.ID);this.group=options.ValidationGroup;this.manager=Prado.Validation.addValidator(options.FormID,this);},getErrorMessage:function() +{this.enabled=true;this.visible=false;this.isValid=true;this._isObserving={};this.group=null;this.requestDispatched=false;this.options=options;this.control=$(options.ControlToValidate);this.message=$(options.ID);if(this.control&&this.message) +{this.group=options.ValidationGroup;this.manager=Prado.Validation.addValidator(options.FormID,this);}},getErrorMessage:function() {return this.options.ErrorMessage;},updateControl:function(focus) {this.refreshControlAndMessage();if(this.options.FocusOnError&&!this.isValid) Prado.Element.focus(this.options.FocusElementID);this.visible=true;},refreshControlAndMessage:function() diff --git a/framework/Web/Javascripts/js/debug/ajax.js b/framework/Web/Javascripts/js/debug/ajax.js index 9b1046ba..def73994 100644 --- a/framework/Web/Javascripts/js/debug/ajax.js +++ b/framework/Web/Javascripts/js/debug/ajax.js @@ -2308,8 +2308,11 @@ Prado.WebUI.ActiveListControl = Base.extend( constructor : function(options) { this.element = $(options.ID); - this.options = options; - Event.observe(this.element, "change", this.doCallback.bind(this)); + if(this.element) + { + this.options = options; + Event.observe(this.element, "change", this.doCallback.bind(this)); + } }, doCallback : function(event) diff --git a/framework/Web/Javascripts/js/debug/prado.js b/framework/Web/Javascripts/js/debug/prado.js index a1a224b9..08c7e428 100644 --- a/framework/Web/Javascripts/js/debug/prado.js +++ b/framework/Web/Javascripts/js/debug/prado.js @@ -3264,8 +3264,11 @@ Prado.WebUI.PostBackControl.prototype = this._elementOnClick = null, //capture the element's onclick function this.element = $(options.ID); - if(this.onInit) - this.onInit(options); + if(this.element) + { + if(this.onInit) + this.onInit(options); + } }, onInit : function(options) @@ -3382,8 +3385,11 @@ Object.extend(Prado.WebUI.TRadioButton.prototype, initialize : function(options) { this.element = $(options['ID']); - if(!this.element.checked) - this.onRadioButtonInitialize(options); + if(this.element) + { + if(!this.element.checked) + this.onRadioButtonInitialize(options); + } } }); diff --git a/framework/Web/Javascripts/js/debug/validator.js b/framework/Web/Javascripts/js/debug/validator.js index f3a37d0f..39ef9d63 100644 --- a/framework/Web/Javascripts/js/debug/validator.js +++ b/framework/Web/Javascripts/js/debug/validator.js @@ -376,9 +376,12 @@ Prado.WebUI.TValidationSummary.prototype = this.options = options; this.group = options.ValidationGroup; this.messages = $(options.ID); - this.visible = this.messages.style.visibility != "hidden" - this.visible = this.visible && this.messages.style.display != "none"; - Prado.Validation.addSummary(options.FormID, this); + if(this.messages) + { + this.visible = this.messages.style.visibility != "hidden" + this.visible = this.visible && this.messages.style.display != "none"; + Prado.Validation.addSummary(options.FormID, this); + } }, /** @@ -589,13 +592,16 @@ Prado.WebUI.TBaseValidator.prototype = this._isObserving = {}; this.group = null; this.requestDispatched = false; - + this.options = options; this.control = $(options.ControlToValidate); this.message = $(options.ID); - this.group = options.ValidationGroup; + if(this.control && this.message) + { + this.group = options.ValidationGroup; - this.manager = Prado.Validation.addValidator(options.FormID, this); + this.manager = Prado.Validation.addValidator(options.FormID, this); + } }, /** diff --git a/framework/Web/Javascripts/prado/activecontrols3.js b/framework/Web/Javascripts/prado/activecontrols3.js index ecdc94cb..bb61d8ea 100644 --- a/framework/Web/Javascripts/prado/activecontrols3.js +++ b/framework/Web/Javascripts/prado/activecontrols3.js @@ -200,8 +200,11 @@ Prado.WebUI.ActiveListControl = Base.extend( constructor : function(options) { this.element = $(options.ID); - this.options = options; - Event.observe(this.element, "change", this.doCallback.bind(this)); + if(this.element) + { + this.options = options; + Event.observe(this.element, "change", this.doCallback.bind(this)); + } }, doCallback : function(event) diff --git a/framework/Web/Javascripts/prado/controls.js b/framework/Web/Javascripts/prado/controls.js index 390b1a25..2127732d 100644 --- a/framework/Web/Javascripts/prado/controls.js +++ b/framework/Web/Javascripts/prado/controls.js @@ -9,8 +9,11 @@ Prado.WebUI.PostBackControl.prototype = this._elementOnClick = null, //capture the element's onclick function this.element = $(options.ID); - if(this.onInit) - this.onInit(options); + if(this.element) + { + if(this.onInit) + this.onInit(options); + } }, onInit : function(options) @@ -127,8 +130,11 @@ Object.extend(Prado.WebUI.TRadioButton.prototype, initialize : function(options) { this.element = $(options['ID']); - if(!this.element.checked) - this.onRadioButtonInitialize(options); + if(this.element) + { + if(!this.element.checked) + this.onRadioButtonInitialize(options); + } } }); diff --git a/framework/Web/Javascripts/prado/validation3.js b/framework/Web/Javascripts/prado/validation3.js index b1734452..4158369f 100644 --- a/framework/Web/Javascripts/prado/validation3.js +++ b/framework/Web/Javascripts/prado/validation3.js @@ -376,9 +376,12 @@ Prado.WebUI.TValidationSummary.prototype = this.options = options; this.group = options.ValidationGroup; this.messages = $(options.ID); - this.visible = this.messages.style.visibility != "hidden" - this.visible = this.visible && this.messages.style.display != "none"; - Prado.Validation.addSummary(options.FormID, this); + if(this.messages) + { + this.visible = this.messages.style.visibility != "hidden" + this.visible = this.visible && this.messages.style.display != "none"; + Prado.Validation.addSummary(options.FormID, this); + } }, /** @@ -589,13 +592,16 @@ Prado.WebUI.TBaseValidator.prototype = this._isObserving = {}; this.group = null; this.requestDispatched = false; - + this.options = options; this.control = $(options.ControlToValidate); this.message = $(options.ID); - this.group = options.ValidationGroup; + if(this.control && this.message) + { + this.group = options.ValidationGroup; - this.manager = Prado.Validation.addValidator(options.FormID, this); + this.manager = Prado.Validation.addValidator(options.FormID, this); + } }, /** diff --git a/framework/Web/UI/ActiveControls/TActivePageAdapter.php b/framework/Web/UI/ActiveControls/TActivePageAdapter.php index 8ea196f9..af3cdd4d 100644 --- a/framework/Web/UI/ActiveControls/TActivePageAdapter.php +++ b/framework/Web/UI/ActiveControls/TActivePageAdapter.php @@ -15,6 +15,7 @@ * Load callback response adapter class. */ Prado::using('System.Web.UI.ActiveControls.TCallbackResponseAdapter'); +Prado::using('System.Web.UI.ActiveControls.TCallbackClientScript'); /** * TActivePageAdapter class. @@ -155,7 +156,7 @@ class TActivePageAdapter extends TControlAdapter if(!is_null($responseData)) { $data = TJavascript::jsonEncode($responseData); - + $this->appendContentPart($response, self::CALLBACK_DATA_HEADER, $data); //$response->appendHeader(self::CALLBACK_DATA_HEADER.': '.$data); } @@ -192,7 +193,7 @@ class TActivePageAdapter extends TControlAdapter /** * Appends data or javascript code to the body content surrounded with delimiters - */ + */ private function appendContentPart($response, $delimiter, $data) { $content = $response->createHtmlWriter(); diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket518.page b/tests/FunctionalTests/tickets/protected/pages/Ticket518.page new file mode 100644 index 00000000..657dc4cf --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket518.page @@ -0,0 +1,10 @@ + +

Not possible to add custom buttons to TinyMCE

+ + + + theme_advanced_buttons3: 'justifyleft,justifycenter' + + + + \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket521.page b/tests/FunctionalTests/tickets/protected/pages/Ticket521.page new file mode 100644 index 00000000..e1f65663 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket521.page @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket521.php b/tests/FunctionalTests/tickets/protected/pages/Ticket521.php new file mode 100644 index 00000000..d28a777a --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket521.php @@ -0,0 +1,16 @@ +label1->Text = "Button 1 was clicked "; + } + public function doSave($s, $p){ + $this->label1->Text .= " on callback "; + + } + + +} +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket521TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket521TestCase.php new file mode 100644 index 00000000..ea9feae8 --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket521TestCase.php @@ -0,0 +1,20 @@ +open("tickets/index.php?page=Ticket521"); + $this->assertTitle("Verifying Ticket 521"); + $this->assertText("{$base}label1", "Label 1"); + + $this->click("{$base}button1"); + $this->pause(1200); + + $this->assertText("{$base}label1", "Button 1 was clicked on callback"); + } + +} + +?> \ No newline at end of file diff --git a/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php b/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php index 8f8868e9..75bbb2a4 100644 --- a/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php +++ b/tests/simple_unit/ActiveRecord/ActiveRecordDynamicCallTestCase.php @@ -1,5 +1,4 @@ -assertNotNull($rs); } + function test_dynamic_delete_by() + { + $finder = DepartmentRecord::finder(); + //$finder->RecordManager->OnDelete[] = array($this, 'assertDeleteSql'); + $this->assertEqual($finder->deleteByName('tasds'), 0); + } + + function assertDeleteSql($sender, $param) + { + var_dump($param); + } + } ?> \ No newline at end of file -- cgit v1.2.3