Permalink
Browse files

Merge branch '2.0' of github.com:cakephp/cakephp into 2.0

  • Loading branch information...
2 parents fff42e9 + a3f25ee commit 5a181d8705293d898b9f37d48a1a49e7c775079d @lorenzo lorenzo committed Sep 30, 2011
@@ -48,7 +48,7 @@ class EmailConfig {
public $smtp = array(
'transport' => 'Smtp',
- 'from' => array('My Site', 'site@localhost'),
+ 'from' => array('site@localhost' => 'My Site'),
'host' => 'localhost',
'port' => 25,
'timeout' => 30,
@@ -48,7 +48,7 @@ class EmailConfig {
public $smtp = array(
'transport' => 'Smtp',
- 'from' => array('My Site', 'site@localhost'),
+ 'from' => array('site@localhost' => 'My Site'),
'host' => 'localhost',
'port' => 25,
'timeout' => 30,
View
@@ -354,7 +354,7 @@ protected function _bindTextDomain($domain) {
/**
* Loads the binary .mo file for translation and sets the values for this translation in the var I18n::_domains
*
- * @param resource $file Binary .mo file to load
+ * @param string $file Binary .mo file to load
* @param string $domain Domain where to load file in
* @return void
*/
@@ -2443,7 +2443,7 @@ protected function _parseKey($model, $key, $value) {
break;
}
$value = "({$value})";
- } elseif ($null) {
+ } elseif ($null || $value === 'NULL') {
switch ($operator) {
case '=':
$operator = 'IS';
@@ -44,8 +44,7 @@ public function send(CakeEmail $email) {
if (!@mail($to, $email->subject(), $message, $headers)) {
throw new SocketException(__d('cake', 'Could not send email.'));
}
- }
- if(!@mail($to, $email->subject(), $message, $headers, $this->_config['additionalParameters'])) {
+ } elseif (!@mail($to, $email->subject(), $message, $headers, $this->_config['additionalParameters'])) {
throw new SocketException(__d('cake', 'Could not send email.'));
}
return array('headers' => $headers, 'message' => $message);
@@ -2219,10 +2219,15 @@ public function testArrayConditionsParsing() {
$expected = " WHERE `Book`.`id` = 0";
$this->assertEqual($expected, $result);
- $result = $this->Dbo->conditions(array("Book.id" => NULL));
+ $result = $this->Dbo->conditions(array("Book.id" => null));
$expected = " WHERE `Book`.`id` IS NULL";
$this->assertEqual($expected, $result);
+ $conditions = array('MysqlModel.id' => '');
+ $result = $this->Dbo->conditions($conditions, true, true, $this->model);
+ $expected = " WHERE `MysqlModel`.`id` IS NULL";
+ $this->assertEqual($result, $expected);
+
$result = $this->Dbo->conditions(array('Listing.beds >=' => 0));
$expected = " WHERE `Listing`.`beds` >= 0";
$this->assertEqual($expected, $result);

0 comments on commit 5a181d8

Please sign in to comment.