summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitattributes10
-rw-r--r--framework/Data/SqlMap/Configuration/TParameterMap.php4
-rw-r--r--framework/Data/SqlMap/Configuration/TResultMap.php4
-rw-r--r--framework/Data/SqlMap/Configuration/TResultProperty.php4
-rw-r--r--framework/Data/SqlMap/DataMapper/TPropertyAccess.php92
-rw-r--r--framework/Data/SqlMap/DataMapper/TSqlMapCache.php136
-rw-r--r--framework/Data/SqlMap/DataMapper/TSqlMapException.php30
-rw-r--r--framework/Web/Javascripts/js/compressed/ajax.js2
-rw-r--r--framework/Web/Javascripts/js/debug/ajax.js1
-rw-r--r--framework/Web/Javascripts/prado/inlineeditor.js1
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page16
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/GerTurno2.php53
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/Home.php11
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page78
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.php13
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/Master1.php7
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/Master1.tpl14
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/MasterTest1.page14
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page10
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/NullStateTest.php11
-rw-r--r--tests/simple_unit/SqlMap/common.php2
-rw-r--r--tests/simple_unit/SqlMap/sqlite/backup.dbbin32768 -> 24576 bytes
-rw-r--r--tests/simple_unit/SqlMap/sqlite/tests.dbbin32768 -> 24576 bytes
23 files changed, 374 insertions, 139 deletions
diff --git a/.gitattributes b/.gitattributes
index 1fc7e06e..2a47c908 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2118,8 +2118,18 @@ tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.page -text
tests/FunctionalTests/active-controls/protected/pages/DelayedCallback.php -text
tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.page -text
tests/FunctionalTests/active-controls/protected/pages/EventTriggeredCallback.php -text
+tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page -text
+tests/FunctionalTests/active-controls/protected/pages/GerTurno2.php -text
+tests/FunctionalTests/active-controls/protected/pages/Home.php -text
+tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page -text
+tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.php -text
tests/FunctionalTests/active-controls/protected/pages/LTemplate.php -text
tests/FunctionalTests/active-controls/protected/pages/LTemplate.tpl -text
+tests/FunctionalTests/active-controls/protected/pages/Master1.php -text
+tests/FunctionalTests/active-controls/protected/pages/Master1.tpl -text
+tests/FunctionalTests/active-controls/protected/pages/MasterTest1.page -text
+tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page -text
+tests/FunctionalTests/active-controls/protected/pages/NullStateTest.php -text
tests/FunctionalTests/active-controls/protected/pages/PopulateActiveList.page -text
tests/FunctionalTests/active-controls/protected/pages/PopulateActiveList.php -text
tests/FunctionalTests/active-controls/protected/pages/PostLoadingTest.page -text
diff --git a/framework/Data/SqlMap/Configuration/TParameterMap.php b/framework/Data/SqlMap/Configuration/TParameterMap.php
index 8d09d9a9..e4d77a91 100644
--- a/framework/Data/SqlMap/Configuration/TParameterMap.php
+++ b/framework/Data/SqlMap/Configuration/TParameterMap.php
@@ -155,7 +155,7 @@ class TParameterMap extends TComponent
* @param mixed object to obtain the property from.
* @param TParameterProperty parameter property.
* @return mixed property value.
- * @throws TSqlMapExecutionException if property access is invalid.
+ * @throws TSqlMapException if property access is invalid.
*/
protected function getObjectValue($object,$property)
{
@@ -165,7 +165,7 @@ class TParameterMap extends TComponent
}
catch (TInvalidPropertyException $e)
{
- throw new TSqlMapExecutionException(
+ throw new TSqlMapException(
'sqlmap_unable_to_get_property_for_parameter',
$this->getID(), $property->getProperty(), get_class($object));
}
diff --git a/framework/Data/SqlMap/Configuration/TResultMap.php b/framework/Data/SqlMap/Configuration/TResultMap.php
index fa798dc2..5c608e77 100644
--- a/framework/Data/SqlMap/Configuration/TResultMap.php
+++ b/framework/Data/SqlMap/Configuration/TResultMap.php
@@ -155,7 +155,7 @@ class TResultMap extends TComponent
* Create a new instance of the class of this result map.
* @param TSqlMapTypeHandlerRegistry type handler registry.
* @return mixed new result object.
- * @throws TSqlMapExecutionException
+ * @throws TSqlMapException
*/
public function createInstanceOfResult($registry)
{
@@ -169,7 +169,7 @@ class TResultMap extends TComponent
}
catch (TSqlMapException $e)
{
- throw new TSqlMapExecutionException(
+ throw new TSqlMapException(
'sqlmap_unable_to_create_new_instance',
$this->getClass(), get_class($handler), $this->getID());
}
diff --git a/framework/Data/SqlMap/Configuration/TResultProperty.php b/framework/Data/SqlMap/Configuration/TResultProperty.php
index e8fc5c38..884f1a78 100644
--- a/framework/Data/SqlMap/Configuration/TResultProperty.php
+++ b/framework/Data/SqlMap/Configuration/TResultProperty.php
@@ -282,10 +282,12 @@ class TResultProperty extends TComponent
{
if(class_exists($type = $this->getType(), false)) //NO force autoloading
{
+ if($type==='TList')
+ return self::LIST_TYPE;
$class = new ReflectionClass($type);
if($class->isSubclassOf('TList'))
return self::LIST_TYPE;
- if($class->inmplementsInterface('ArrayAccess'))
+ if($class->implementsInterface('ArrayAccess'))
return self::ARRAY_TYPE;
}
if(strtolower($type) == 'array')
diff --git a/framework/Data/SqlMap/DataMapper/TPropertyAccess.php b/framework/Data/SqlMap/DataMapper/TPropertyAccess.php
index fea94fa4..901072ea 100644
--- a/framework/Data/SqlMap/DataMapper/TPropertyAccess.php
+++ b/framework/Data/SqlMap/DataMapper/TPropertyAccess.php
@@ -1,41 +1,54 @@
<?php
+/**
+ * TPropertyAccess class file.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2007 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @package System.Data.SqlMap.DataMapper
+ */
+/**
+ * TPropertyAccess class provides dot notation stype property access and setting.
+ *
+ * Access object's properties (and subproperties) using dot path notation.
+ * The following are equivalent.
+ * <code>
+ * echo $obj->property1;
+ * echo $obj->getProperty1();
+ * echo $obj['property1']; //$obj may be an array or object
+ * echo TPropertyAccess($obj, 'property1');
+ * </code>
+ *
+ * Setting a property value.
+ * <code>
+ * $obj1->propert1 = 'hello';
+ * $obj->setProperty('hello');
+ * $obj['property1'] = 'hello'; //$obj may be an array or object
+ * TPropertyAccess($obj, 'property1', 'hello');
+ * </code>
+ *
+ * Subproperties are supported using the dot notation. E.g.
+ * <code>
+ * echo $obj->property1->property2->property3
+ * echo TPropertyAccess::get($obj, 'property1.property2.property3');
+ * </code>
+ *
+ * @author Wei Zhuo <weizho[at]gmail[dot]com>
+ * @version $Id$
+ * @package System.Data.SqlMap.DataMapper
+ * @since 3.1
+ */
class TPropertyAccess
{
- private $_obj;
- private $_performance=false;
-
- public function __construct($obj,$performance=false)
- {
- $this->_obj = $obj;
- $this->_performance=$performance;
- }
-
- public function __get($name)
- {
- return self::get($this->_obj,$name,$this->_performance);
- }
-
- public function __set($name,$value)
- {
- self::set($this->_obj,$name,$value,$this->_performance);
- }
-
/**
- * Evaluates the data value at the specified field.
- * - If the data is an array, then the field is treated as an array index
- * and the corresponding element value is returned;
- * - If the data is a TMap or TList object, then the field is treated as a key
- * into the map or list, and the corresponding value is returned.
- * - If the data is an object, the field is treated as a property or subproperty
- * defined with getter methods. For example, if the object has a method called
- * getMyValue(), then field 'MyValue' will retrive the result of this method call.
- * If getMyValue() returns an object which contains a method getMySubValue(),
- * then field 'MyValue.MySubValue' will return that method call result.
- * @param mixed data containing the field value, can be an array, TMap, TList or object.
- * @param mixed field value
- * @return mixed value at the specified field
- * @throw TInvalidDataValueException if field or data is invalid
+ * Gets the property value.
+ * @param mixed object or path.
+ * @param string property path.
+ * @return mixed property value.
+ * @throws TInvalidDataValueException if property path is invalid.
*/
public static function get($object,$path)
{
@@ -67,6 +80,11 @@ class TPropertyAccess
return $object;
}
+ /**
+ * @param mixed object or array
+ * @param string property path.
+ * @return boolean true if property path is valid
+ */
public static function has($object, $path)
{
if(!is_array($object) && !is_object($object))
@@ -96,6 +114,13 @@ class TPropertyAccess
return true;
}
+ /**
+ * Sets the property value.
+ * @param mixed object or array
+ * @param string property path.
+ * @param mixed new property value.
+ * @throws TInvalidDataValueException if property path is invalid.
+ */
public static function set(&$originalObject, $path, $value)
{
$properties = explode('.', $path);
@@ -105,7 +130,6 @@ class TPropertyAccess
else
$object = &$originalObject;
- //var_dump($object);
if(is_array($object) || $object instanceof ArrayAccess)
{
$object[$prop] = $value;
diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapCache.php b/framework/Data/SqlMap/DataMapper/TSqlMapCache.php
index 5cb9cbcb..a47ed52a 100644
--- a/framework/Data/SqlMap/DataMapper/TSqlMapCache.php
+++ b/framework/Data/SqlMap/DataMapper/TSqlMapCache.php
@@ -7,20 +7,9 @@
* @copyright Copyright &copy; 2005-2007 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
- * @package System.DataAccess.SQLMap
+ * @package System.Data.SqlMap.DataMapper
*/
-interface ISqLMapCache
-{
- public function remove($key);
-
- public function flush();
-
- public function get($key);
-
- public function set($key, $value);
-}
-
/**
* Allow different implementation of caching strategy. See <tt>TSqlMapFifoCache</tt>
* for a first-in-first-out implementation. See <tt>TSqlMapLruCache</tt> for
@@ -28,10 +17,10 @@ interface ISqLMapCache
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @version $Id$
- * @package System.DataAccess.SQLMap
- * @since 3.0
+ * @package System.Data.SqlMap.DataMapper
+ * @since 3.1
*/
-abstract class TSqlMapCache implements ISqlMapCache
+abstract class TSqlMapCache implements ICache
{
protected $_keyList;
protected $_cache;
@@ -48,11 +37,18 @@ abstract class TSqlMapCache implements ISqlMapCache
$this->_keyList = new TList;
}
+ /**
+ * Maximum number of items to cache. Default size is 100.
+ * @param int cache size.
+ */
public function setCacheSize($value)
{
$this->_cacheSize=TPropertyValue::ensureInteger($value,100);
}
+ /**
+ * @return int cache size.
+ */
public function getCacheSize()
{
return $this->_cacheSize;
@@ -61,7 +57,7 @@ abstract class TSqlMapCache implements ISqlMapCache
/**
* @return object the object removed if exists, null otherwise.
*/
- public function remove($key)
+ public function delete($key)
{
$object = $this->get($key);
$this->_cache->remove($key);
@@ -78,6 +74,13 @@ abstract class TSqlMapCache implements ISqlMapCache
$this->_cache->clear();
}
+ /**
+ * @throws TSqlMapException not implemented.
+ */
+ public function add($id,$value,$expire=0,$dependency=null)
+ {
+ throw new TSqlMapException('sqlmap_use_set_to_store_cache');
+ }
}
/**
@@ -86,8 +89,8 @@ abstract class TSqlMapCache implements ISqlMapCache
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @version $Id$
- * @package System.DataAccess.SQLMap
- * @since 3.0
+ * @package System.Data.SqlMap.DataMapper
+ * @since 3.1
*/
class TSqlMapFifoCache extends TSqlMapCache
{
@@ -100,11 +103,12 @@ class TSqlMapFifoCache extends TSqlMapCache
}
/**
- * Adds an item with the specified key and value into cached data.
+ * Stores a value identified by a key into cache.
+ * The expire and dependency parameters are ignored.
* @param string cache key
* @param mixed value to cache.
*/
- public function set($key, $value)
+ public function set($key, $value,$expire=0,$dependency=null)
{
$this->_cache->add($key, $value);
$this->_keyList->add($key);
@@ -122,8 +126,8 @@ class TSqlMapFifoCache extends TSqlMapCache
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @version $Id$
- * @package System.DataAccess.SQLMap
- * @since 3.0
+ * @package System.Data.SqlMap.DataMapper
+ * @since 3.1
*/
class TSqlMapLruCache extends TSqlMapCache
{
@@ -138,16 +142,15 @@ class TSqlMapLruCache extends TSqlMapCache
$this->_keyList->add($key);
return $this->_cache->itemAt($key);
}
- else
- return null;
}
/**
- * Adds an item with the specified key and value into cached data.
- * @param string cache key
- * @param mixed value to cache.
+ * Stores a value identified by a key into cache.
+ * The expire and dependency parameters are ignored.
+ * @param string the key identifying the value to be cached
+ * @param mixed the value to be cached
*/
- public function set($key, $value)
+ public function set($key, $value,$expire=0,$dependency=null)
{
$this->_cache->add($key, $value);
$this->_keyList->add($key);
@@ -159,71 +162,66 @@ class TSqlMapLruCache extends TSqlMapCache
}
}
-class TSqlMapApplicationCache implements ISqlMapCache
+/**
+ * TSqlMapApplicationCache uses the default Prado application cache for
+ * caching SqlMap results.
+ *
+ * @author Wei Zhuo <weizho[at]gmail[dot]com>
+ * @version $Id$
+ * @package System.Data.SqlMap.DataMapper
+ * @since 3.1
+ */
+class TSqlMapApplicationCache implements ICache
{
- private $_cache;
- private $_expiry=0;
- private $_property=array();
- private $_cacheModelID;
-
- public function __sleep()
- {
- $this->_cache = null;
- return array_keys(get_object_vars($this));
- }
-
- public function remove($key)
+ /**
+ * @param string item to be deleted.
+ */
+ public function delete($key)
{
$this->getCache()->delete($key);
}
+ /**
+ * Deletes all items in the cache.
+ */
public function flush()
{
$this->getCache()->flush();
}
+ /**
+ * @return mixed Gets a cached object with the specified key.
+ */
public function get($key)
{
$result = $this->getCache()->get($key);
return $result === false ? null : $result;
}
- public function set($key, $value)
- {
- $this->getCache()->set($key, $value, $this->_expiry);
- }
-
- public function configure($model, $properties)
+ /**
+ * Stores a value identified by a key into cache.
+ * @param string the key identifying the value to be cached
+ * @param mixed the value to be cached
+ */
+ public function set($key, $value,$expire=0,$dependency=null)
{
- $this->_property = $properties;
- $this->_cacheModelID = $model->getID();
+ $this->getCache()->set($key, $value, $expire,$dependency);
}
+ /**
+ * @return ICache Application cache instance.
+ */
protected function getCache()
{
- if(is_null($this->_cache))
- $this->initialize();
- return $this->_cache;
+ return Prado::getApplication()->getCache();
}
- protected function initialize()
+ /**
+ * @throws TSqlMapException not implemented.
+ */
+ public function add($id,$value,$expire=0,$dependency=null)
{
- if(isset($this->_property['expiry']))
- $this->_expiry = intval($this->_property['expiry']);
-
- if(isset($this->_property['cacheModule']))
- {
- $id = $this->_property['cacheModule'];
- $this->_cache = Prado::getApplication()->getModule($id);
- }
- else
- {
- $this->_cache = Prado::getApplication()->getCache();
- }
-
- if(!($this->_cache instanceof ICache))
- throw new TSqlMapConfigurationException(
- 'sqlmap_invalid_prado_cache', $this->_cacheModelID);
+ throw new TSqlMapException('sqlmap_use_set_to_store_cache');
}
}
diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapException.php b/framework/Data/SqlMap/DataMapper/TSqlMapException.php
index 9a2db478..52fedb13 100644
--- a/framework/Data/SqlMap/DataMapper/TSqlMapException.php
+++ b/framework/Data/SqlMap/DataMapper/TSqlMapException.php
@@ -54,31 +54,6 @@ class TSqlMapConfigurationException extends TSqlMapException
}
-class TUndefinedAttributeException extends TSqlMapConfigurationException
-{
- public function __construct($attr, $node, $object, $file)
- {
- parent::__construct(
- 'sqlmap_undefined_attribute', get_class($object), $attr,
- htmlentities($node->asXml()),$file);
- }
-}
-
-class TSqlMapExecutionException extends TSqlMapException
-{
-}
-
-class TSqlMapQueryExecutionException extends TSqlMapExecutionException
-{
- protected $parent;
- public function __construct($statement, $exception)
- {
- $this->parent = $exception;
- parent::__construct('sqlmap_query_execution_error',
- $statement->getID(), $exception->getMessage());
- }
-}
-
class TSqlMapUndefinedException extends TSqlMapException
{
@@ -88,12 +63,9 @@ class TSqlMapDuplicateException extends TSqlMapException
{
}
-class TSqlMapConnectionException extends TSqlMapException
-{
-}
class TInvalidPropertyException extends TSqlMapException
{
-
}
+
?> \ 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 4e3bb18d..4b260ab3 100644
--- a/framework/Web/Javascripts/js/compressed/ajax.js
+++ b/framework/Web/Javascripts/js/compressed/ajax.js
@@ -276,7 +276,7 @@ this.time=setTimeout(this.checkChanges.bind(this),parseInt(this.options.Interval
{var request=new Prado.CallbackRequest(this.options.EventTarget,this.options);var param={'OldValue':oldValue,'NewValue':newValue};request.setCallbackParameter(param);request.dispatch();}},{timers:{},register:function(timer)
{Prado.WebUI.TValueTriggeredCallback.timers[timer.options.ID]=timer;},stop:function(id)
{Prado.WebUI.TValueTriggeredCallback.timers[id].stopObserving();}});Prado.WebUI.TInPlaceTextBox=Base.extend({isSaving:false,isEditing:false,editField:null,constructor:function(options)
-{this.options=Object.extend({LoadTextFromSource:false,TextMode:'SingleLine'},options||{});this.element=$(this.options.ID);Prado.WebUI.TInPlaceTextBox.register(this);this.initializeListeners();},initializeListeners:function()
+{this.options=Object.extend({LoadTextFromSource:false,TextMode:'SingleLine'},options||{});this.element=$(this.options.ID);Prado.WebUI.TInPlaceTextBox.register(this);this.createEditorInput();this.initializeListeners();},initializeListeners:function()
{this.onclickListener=this.enterEditMode.bindAsEventListener(this);Event.observe(this.element,'click',this.onclickListener);if(this.options.ExternalControl)
Event.observe($(this.options.ExternalControl),'click',this.onclickListener);},enterEditMode:function(evt)
{if(this.isSaving||this.isEditing)return;this.isEditing=true;this.onEnterEditMode();this.createEditorInput();this.showTextBox();this.editField.disabled=false;if(this.options.LoadTextOnEdit)
diff --git a/framework/Web/Javascripts/js/debug/ajax.js b/framework/Web/Javascripts/js/debug/ajax.js
index 65751d27..d26ad640 100644
--- a/framework/Web/Javascripts/js/debug/ajax.js
+++ b/framework/Web/Javascripts/js/debug/ajax.js
@@ -2457,6 +2457,7 @@ Prado.WebUI.TInPlaceTextBox = Base.extend(
}, options || {});
this.element = $(this.options.ID);
Prado.WebUI.TInPlaceTextBox.register(this);
+ this.createEditorInput();
this.initializeListeners();
},
diff --git a/framework/Web/Javascripts/prado/inlineeditor.js b/framework/Web/Javascripts/prado/inlineeditor.js
index de74585f..c73985f7 100644
--- a/framework/Web/Javascripts/prado/inlineeditor.js
+++ b/framework/Web/Javascripts/prado/inlineeditor.js
@@ -14,6 +14,7 @@ Prado.WebUI.TInPlaceTextBox = Base.extend(
}, options || {});
this.element = $(this.options.ID);
Prado.WebUI.TInPlaceTextBox.register(this);
+ this.createEditorInput();
this.initializeListeners();
},
diff --git a/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page b/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page
new file mode 100644
index 00000000..f4bf644c
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.page
@@ -0,0 +1,16 @@
+<com:TForm>
+
+<com:TLabel ForControl="DDropTurno" Text="Turno:"/>
+<com:TActiveDropDownList ID="DDropTurno"
+ onSelectedIndexChanged="trocaTurno" AutoPostBack="true"/>
+
+<com:TLabel Text="Código:" ForControl="Codigo"/>
+<com:TActiveTextBox ID="Codigo" MaxLength="10" Columns="2"/>
+
+<com:TLabel Text="Descrição:" ForControl="Descricao"/>
+<com:TActiveTextBox ID="Descricao" MaxLength="25" Columns="25"/>
+
+
+<com:TJavascriptLogger />
+
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.php b/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.php
new file mode 100644
index 00000000..d31c10f6
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/GerTurno2.php
@@ -0,0 +1,53 @@
+<?php
+
+class GerTurno2 extends TPage {
+
+ private $_turnos = null;
+
+
+ public function onLoad($param) {
+ parent::onLoad($param);
+
+ $this->loadTurnoOptions();
+
+ if (!$this->IsPostBack) {
+ $this->ativaModoEdicao();
+ }
+ }
+
+
+ protected function loadTurnoOptions()
+ {
+ $this->DDropTurno->DataTextField="descricao";
+ $this->DDropTurno->DataValueField="id";
+ $this->_turnos = array(
+ array('id' => 1, 'codigo'=>'test 1', 'descricao' => 'hello 1'),
+ array('id' => 2, 'codigo'=>'test 2', 'descricao' => 'hello 2')
+ );
+ $this->DDropTurno->setDataSource($this->_turnos);
+ $this->DDropTurno->dataBind();
+ }
+
+
+ protected function ativaModoEdicao() {
+ $this->loadDadosTurno($this->DDropTurno->getSelectedValue());
+ }
+
+
+ protected function loadDadosTurno($id) {
+ foreach ($this->_turnos as $key => $tur) {
+ if ($tur['id'] == $id) {
+ $this->Codigo->setText($tur['codigo']);
+ $this->Descricao->setText($tur['descricao']);
+ }
+ }
+ }
+
+
+ public function trocaTurno($sender,$param) {
+ $this->loadDadosTurno($sender->getSelectedValue());
+ }
+
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/Home.php b/tests/FunctionalTests/active-controls/protected/pages/Home.php
new file mode 100644
index 00000000..22b6528a
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/Home.php
@@ -0,0 +1,11 @@
+<?php
+
+class Home extends TPage
+{
+ public function btnTest_OnCallback($sender,$param)
+ {
+ $this->lblTest->Text = "Testing";
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page b/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page
new file mode 100644
index 00000000..ba3a35db
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.page
@@ -0,0 +1,78 @@
+
+<style>
+ .textbox
+ {
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 1.2em;
+ display: block;
+ width: 20em;
+ }
+
+ .textbox
+ {
+ padding: 2px 0px 4px 2px;
+ border:1px solid #eee;
+ }
+
+
+ input.textbox
+ {
+ background-color: #ffc;
+ }
+ .loader
+ {
+ position:absolute;
+ right:0px;
+ top:0px;
+ color:white;
+ background-color:#900;
+ padding: 0.5em 1em;
+ }
+ input.required
+ {
+ border: 1px solid red;
+ background-color: pink;
+ }
+</style>
+
+<com:TForm>
+ <com:TInPlaceTextBox
+ ID="Firstname"
+ Text="firstname"
+ CssClass="textbox"
+ ValidationGroup="Group"
+ />
+ <com:TRequiredFieldValidator
+ ControlToValidate="Firstname"
+ ErrorMessage="Firstname required"
+ InitialValue="firstname"
+ ValidationGroup="Group"
+ />
+ <br />
+ <com:TTextBox
+ ID="Lastname"
+ Text="lastname"
+ />
+ <com:TRequiredFieldValidator
+ ControlToValidate="Lastname"
+ ErrorMessage="Lastname required"
+ InitialValue="lastname"
+ ValidationGroup="Group"
+ />
+ <br />
+ <com:TActiveButton ID="active_button"
+ Text="Active Submit"
+ ValidationGroup="Group"
+ CausesValidation="true"
+ OnCallback="button_valid"
+ />
+ <com:TButton ID="passive_button"
+ Text="Passive Submit"
+ ValidationGroup="Group"
+ CausesValidation="true"
+ OnClick="button_valid"
+ />
+ <br />
+ <com:TActiveLabel ID="status" Text="Status:" />
+ <com:TJavascriptLogger />
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.php b/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.php
new file mode 100644
index 00000000..e69ffdf2
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/InPlaceWithValidator.php
@@ -0,0 +1,13 @@
+<?php
+
+class InPlaceWithValidator extends TPage
+{
+ function button_valid($sender, $param){
+
+ $this->status->Text = "Status: ". $this->Firstname->Text.".".$this->Lastname->Text;
+
+ }
+
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/Master1.php b/tests/FunctionalTests/active-controls/protected/pages/Master1.php
new file mode 100644
index 00000000..173a59f0
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/Master1.php
@@ -0,0 +1,7 @@
+<?php
+
+class Master1 extends TTemplateControl
+{
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/Master1.tpl b/tests/FunctionalTests/active-controls/protected/pages/Master1.tpl
new file mode 100644
index 00000000..5e63d57d
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/Master1.tpl
@@ -0,0 +1,14 @@
+...
+<com:TPanel ID="blockMenu">
+ <com:TContentPlaceHolder ID="cphPnlMenu" />
+</com:TPanel>
+
+<com:TPanel ID="blockContent">
+ <com:TContentPlaceHolder ID="cphPnlMain" />
+</com:TPanel>
+
+<com:TPanel ID="blockLogin">
+ <com:TContentPlaceHolder ID="cphPnlLogin" />
+</com:TPanel>
+
+... \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/MasterTest1.page b/tests/FunctionalTests/active-controls/protected/pages/MasterTest1.page
new file mode 100644
index 00000000..7f6863cf
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/MasterTest1.page
@@ -0,0 +1,14 @@
+<%@ MasterClass="Application.pages.Master1" %>
+<com:TContent ID="cphPnlMenu">
+men
+</com:TContent>
+
+<com:TContent ID="cphPnlLogin">
+<fieldset>
+ [color=red]<problem>[/color]
+</fieldset>
+</com:TContent>
+
+<com:TContent ID="cphPnlMain">
+ad
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page b/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page
new file mode 100644
index 00000000..2ce98f5b
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.page
@@ -0,0 +1,10 @@
+<com:TForm>
+
+<h1>Null State Test</h1>
+
+<com:TActiveLabel ID="lblTest"/>
+<com:TActiveButton OnCallback="btnTest_OnCallback" Text="Clickme"/>
+
+<com:TJavascriptLogger />
+
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.php b/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.php
new file mode 100644
index 00000000..0abd8eb5
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/NullStateTest.php
@@ -0,0 +1,11 @@
+<?php
+
+class NullStateTest extends TPage
+{
+ public function btnTest_OnCallback($sender,$param)
+ {
+ $this->lblTest->Text = "Testing";
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/simple_unit/SqlMap/common.php b/tests/simple_unit/SqlMap/common.php
index 2856f66e..57685c31 100644
--- a/tests/simple_unit/SqlMap/common.php
+++ b/tests/simple_unit/SqlMap/common.php
@@ -76,7 +76,7 @@ class SQLiteBaseTestConfig extends BaseTestConfig
$this->targetFile = realpath(SQLMAP_TESTS.'/sqlite/tests.db');
$this->baseFile = realpath(SQLMAP_TESTS.'/sqlite/backup.db');
$file = realpath($this->targetFile);
- $this->_connection = new TDbConnection("sqlite2:{$file}");
+ $this->_connection = new TDbConnection("sqlite:{$file}");
}
public function getScriptRunner()
diff --git a/tests/simple_unit/SqlMap/sqlite/backup.db b/tests/simple_unit/SqlMap/sqlite/backup.db
index fa66b2cc..4f5a353d 100644
--- a/tests/simple_unit/SqlMap/sqlite/backup.db
+++ b/tests/simple_unit/SqlMap/sqlite/backup.db
Binary files differ
diff --git a/tests/simple_unit/SqlMap/sqlite/tests.db b/tests/simple_unit/SqlMap/sqlite/tests.db
index fa66b2cc..290c8899 100644
--- a/tests/simple_unit/SqlMap/sqlite/tests.db
+++ b/tests/simple_unit/SqlMap/sqlite/tests.db
Binary files differ