diff --git a/cake/libs/view/helpers/xml.php b/cake/libs/view/helpers/xml.php index f5a84c1dd..05c8ce564 100644 --- a/cake/libs/view/helpers/xml.php +++ b/cake/libs/view/helpers/xml.php @@ -249,11 +249,7 @@ class XmlHelper extends AppHelper { if (!class_exists('XML') && !class_exists('xml')) { uses('xml'); } - - $options = am( - array('attributes' => false, 'format' => 'xml'), - $options - ); + $options = am(array('attributes' => false, 'format' => 'xml'), $options); switch ($options['format']) { case 'xml': diff --git a/cake/tests/cases/libs/controller/components/dbacl/models/aclnode.test.php b/cake/tests/cases/libs/controller/components/dbacl/models/aclnode.test.php index 5761de180..4bc0356df 100644 --- a/cake/tests/cases/libs/controller/components/dbacl/models/aclnode.test.php +++ b/cake/tests/cases/libs/controller/components/dbacl/models/aclnode.test.php @@ -33,7 +33,7 @@ require_once LIBS.'controller'.DS.'components'.DS.'dbacl'.DS.'models'.DS.'aclnode.php'; require_once LIBS.'controller'.DS.'components'.DS.'dbacl'.DS.'models'.DS.'aco.php'; require_once LIBS.'controller'.DS.'components'.DS.'dbacl'.DS.'models'.DS.'aro.php'; - require_once LIBS.'controller'.DS.'components'.DS.'dbacl'.DS.'models'.DS.'aros_aco.php'; + require_once LIBS.'controller'.DS.'components'.DS.'dbacl'.DS.'models'.DS.'permission.php'; /** * Short description for class. * diff --git a/cake/tests/cases/libs/model/datasources/dbo_source.test.php b/cake/tests/cases/libs/model/datasources/dbo_source.test.php index 12101259a..4b05f9936 100644 --- a/cake/tests/cases/libs/model/datasources/dbo_source.test.php +++ b/cake/tests/cases/libs/model/datasources/dbo_source.test.php @@ -183,6 +183,10 @@ class DboSourceTest extends UnitTestCase { $result = $this->db->conditions('NOT Post.title_extended IS NULL AND NOT Post.title IS NULL AND Post.title_extended != Post.title'); $expected = ' WHERE NOT `Post`.`title_extended` IS NULL AND NOT `Post`.`title` IS NULL AND `Post`.`title_extended` != `Post`.`title`'; $this->assertEqual($result, $expected); + + $result = $this->db->conditions("Comment.id = 'a'"); + $expected = " WHERE `Comment`.`id` = 'a'"; + $this->assertEqual($result, $expected); } function testArrayConditionsParsing() { @@ -205,6 +209,14 @@ class DboSourceTest extends UnitTestCase { $result = $this->db->conditions(array('SUM(Post.comments_count)' => '> 500')); $expected = " WHERE SUM(`Post`.`comments_count`) > 500"; $this->assertEqual($result, $expected); + + $result = $this->db->conditions(array('title' => 'LIKE %hello')); + $expected = " WHERE (`title` LIKE '%hello')"; + $this->assertEqual($result, $expected); + + $result = $this->db->conditions(array('Post.name' => 'mad(g)ik')); + $expected = " WHERE (`Post`.`name` mad(g) 'ik')"; + $this->assertEqual($result, $expected); } function testFieldParsing() { @@ -229,6 +241,10 @@ class DboSourceTest extends UnitTestCase { $expected = array('TestModel.field_name' => '= value'); $this->assertEqual($result, $expected); + $result = $this->db->query('findAllById', array('a'), $this->model); + $expected = array('TestModel.id' => '= value'); + $this->assertEqual($result, $expected); + $result = $this->db->query('findByFieldName', array(array('value1', 'value2', 'value3')), $this->model); $expected = array('TestModel.field_name' => array('value1', 'value2', 'value3')); $this->assertEqual($result, $expected); @@ -242,6 +258,12 @@ class DboSourceTest extends UnitTestCase { $this->assertEqual($result, $expected); } + function testOrderParsing() { + $result = $this->db->order("ADDTIME(Event.time_begin, '-06:00:00') ASC"); + $expected = " ORDER BY ADDTIME(`Event`.`time_begin`, '-06:00:00') ASC"; + $this->assertEqual($result, $expected); + } + function testSomething() { $this->model->Test2 = new TestModel2(); $this->model->hasAndBelongsToMany = array('Test2' => array( diff --git a/cake/tests/cases/libs/view/helpers/ajax.test.php b/cake/tests/cases/libs/view/helpers/ajax.test.php index 1b7ffe010..69e270236 100644 --- a/cake/tests/cases/libs/view/helpers/ajax.test.php +++ b/cake/tests/cases/libs/view/helpers/ajax.test.php @@ -57,6 +57,11 @@ class AjaxTest extends UnitTestCase { $this->assertEqual($result, $expected); } + function testAutoComplete() { + //$result = $this->ajax->autoComplete('Post/title' , '/posts', array('minChars' => 2)); + //pr($result); + } + function testAsynchronous() { $result = $this->ajax->link('Test Link', '/', array('id' => 'link1', 'update' => 'content', 'type' => 'synchronous')); $expected = 'Test Link'; @@ -69,6 +74,12 @@ class AjaxTest extends UnitTestCase { $this->assertEqual($result, $expected); } + function testDroppable() { + $result = $this->ajax->drop('droppable', array('accept' => 'crap')); + $expected = ''; + $this->assertEqual($result, $expected); + } + function tearDown() { unset($this->ajax); }