Skip to content
Browse files

Merge branch '1.3' of git://github.com/cakephp/cakephp into 1.3

  • Loading branch information...
2 parents 72f4ce8 + 27952eb commit d296fd1c006f715e29778e8ccd26def73c26f2c3 @ceeram ceeram committed Apr 4, 2011
View
1 cake/console/templates/default/classes/controller.ctp
@@ -58,4 +58,3 @@ echo $actions;
endif; ?>
}
-<?php echo "?>"; ?>
View
1 cake/console/templates/default/classes/fixture.ctp
@@ -39,4 +39,3 @@ class <?php echo $model; ?>Fixture extends CakeTestFixture {
var $records = <?php echo $records; ?>;
<?php endif;?>
}
-<?php echo '?>'; ?>
View
1 cake/console/templates/default/classes/model.ctp
@@ -139,4 +139,3 @@ if (!empty($associations['hasAndBelongsToMany'])):
endif;
?>
}
-<?php echo '?>'; ?>
View
1 cake/console/templates/default/classes/test.ctp
@@ -54,4 +54,3 @@ class <?php echo $fullClassName; ?>TestCase extends CakeTestCase {
<?php endforeach;?>
}
-<?php echo '?>'; ?>
View
13 cake/libs/class_registry.php
@@ -71,27 +71,28 @@ function &getInstance() {
}
/**
- * Loads a class, registers the object in the registry and returns instance of the object.
+ * Loads a class, registers the object in the registry and returns instance of the object. ClassRegistry::init()
+ * is used as a factory for models, and handle correct injecting of settings, that assist in testing.
*
* Examples
* Simple Use: Get a Post model instance ```ClassRegistry::init('Post');```
*
- * Exapanded: ```array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'TypeOfClass');```
+ * Exapanded: ```array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'Model');```
*
* Model Classes can accept optional ```array('id' => $id, 'table' => $table, 'ds' => $ds, 'alias' => $alias);```
*
* When $class is a numeric keyed array, multiple class instances will be stored in the registry,
* no instance of the object will be returned
* {{{
* array(
- * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'TypeOfClass'),
- * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'TypeOfClass'),
- * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'TypeOfClass')
+ * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'Model'),
+ * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'Model'),
+ * array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'Model')
* );
* }}}
* @param mixed $class as a string or a single key => value array instance will be created,
* stored in the registry and returned.
- * @param string $type TypeOfClass
+ * @param string $type Only model is accepted as a valid value for $type.
* @return object instance of ClassName
* @access public
* @static
View
2 cake/libs/controller/controller.php
@@ -843,7 +843,7 @@ function validateErrors() {
$object =& $this->{$object->alias};
}
$object->set($object->data);
- $errors = array_merge($errors, $object->invalidFields());
+ $errors = array_merge($errors, (array)$object->invalidFields());
}
return $this->validationErrors = (!empty($errors) ? $errors : false);
View
2 cake/libs/view/helpers/text.php
@@ -145,7 +145,7 @@ function autoLinkEmails($text, $options = array()) {
$atom = '[a-z0-9!#$%&\'*+\/=?^_`{|}~-]';
return preg_replace_callback(
- '/(' . $atom . '+(?:\.' . $atom . '+)*@[a-z0-9-]+(?:\.[a-z0-9-]+)*)/i',
+ '/(' . $atom . '+(?:\.' . $atom . '+)*@[a-z0-9-]+(?:\.[a-z0-9-]+)+)/i',
create_function('$matches', '$Html = new HtmlHelper(); $Html->tags = $Html->loadConfig(); return $Html->link($matches[0], "mailto:" . $matches[0],' . $linkOptions . ');'), $text);
}
View
4 cake/tests/cases/libs/model/model_write.test.php
@@ -3903,7 +3903,7 @@ function testUpdateAllEmptyValues() {
}
/**
- * testProductUpdateAllWithForeignKey
+ * testUpdateAllWithJoins
*
* @link http://code.cakephp.org/tickets/view/69
* @access public
@@ -3954,7 +3954,7 @@ function testUpdateAllWithJoins() {
}
/**
- * testProductUpdateAllWithoutForeignKey
+ * testUpdateAllWithoutForeignKey
*
* @link http://code.cakephp.org/tickets/view/69
* @access public
View
11 cake/tests/cases/libs/view/helpers/text.test.php
@@ -321,6 +321,17 @@ function testAutoLinkEmails() {
}
/**
+ * test invalid email addresses.
+ *
+ * @return void
+ */
+ function testAutoLinkEmailInvalid() {
+ $result = $this->Text->autoLinkEmails('this is a myaddress@gmx-de test');
+ $expected = 'this is a myaddress@gmx-de test';
+ $this->assertEqual($expected, $result);
+ }
+
+/**
* testHighlightCaseInsensitivity method
*
* @access public

0 comments on commit d296fd1

Please sign in to comment.
Something went wrong with that request. Please try again.