Merge branch 'master' into 2.6

This commit is contained in:
mark_story 2014-07-02 23:39:16 -04:00
commit b1610c145e
14 changed files with 163 additions and 133 deletions

View file

@ -17,10 +17,6 @@ services:
matrix:
fast_finish: true
allow_failures:
- php: 5.4
env:
- PHPCS=1
include:
- php: 5.4
env:
@ -123,9 +119,9 @@ before_script:
}
}
}" > app/Config/database.php
script:
- sh -c "if [ '$PHPCS' = '1' ]; then phpcs -p --extensions=php --standard=CakePHP ./lib/Cake; elif [ '$DB' = 'mysql' ]; then ./lib/Cake/Console/cake test core AllTests --stderr; else ./lib/Cake/Console/cake test core AllDbRelated --stderr; fi"
- sh -c "if [ '$PHPCS' != '1' ]; then ./lib/Cake/Console/cake test core AllTests --stderr; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then phpcs -p --extensions=php --standard=CakePHP ./lib/Cake; fi;"
notifications:
email: false

View file

@ -58,7 +58,9 @@ class ConsoleErrorHandler {
$exception->getMessage(),
$exception->getTraceAsString()
));
return $this->_stop($exception->getCode() ? $exception->getCode() : 1);
$code = $exception->getCode();
$code = ($code && is_int($code)) ? $code : 1;
return $this->_stop($code);
}
/**

View file

@ -89,8 +89,8 @@ class AclNode extends Model {
)),
'order' => $db->name("{$type}.lft") . ' DESC'
);
$conditionsAfterJoin = array();
$conditionsAfterJoin = array();
foreach ($path as $i => $alias) {
$j = $i - 1;
@ -103,20 +103,18 @@ class AclNode extends Model {
$db->name("{$type}{$i}.alias") . ' = ' . $db->value($alias, 'string')
)
);
// it will be better if this conditions will performs after join operation
$conditionsAfterJoin[] = $db->name("{$type}{$j}.id") . ' = ' . $db->name("{$type}{$i}.parent_id");
$conditionsAfterJoin[] = $db->name("{$type}{$i}.rght") . ' < ' . $db->name("{$type}{$j}.rght");
$conditionsAfterJoin[] = $db->name("{$type}{$i}.lft") . ' > ' . $db->name("{$type}{$j}.lft");
// it will be better if this conditions will performs after join operation
$conditionsAfterJoin[] = $db->name("{$type}{$j}.id") . ' = ' . $db->name("{$type}{$i}.parent_id");
$conditionsAfterJoin[] = $db->name("{$type}{$i}.rght") . ' < ' . $db->name("{$type}{$j}.rght");
$conditionsAfterJoin[] = $db->name("{$type}{$i}.lft") . ' > ' . $db->name("{$type}{$j}.lft");
$queryData['conditions'] = array('or' => array(
$db->name("{$type}.lft") . ' <= ' . $db->name("{$type}0.lft") . ' AND ' . $db->name("{$type}.rght") . ' >= ' . $db->name("{$type}0.rght"),
$db->name("{$type}.lft") . ' <= ' . $db->name("{$type}{$i}.lft") . ' AND ' . $db->name("{$type}.rght") . ' >= ' . $db->name("{$type}{$i}.rght"))
);
}
$queryData['conditions'] = array_merge($queryData['conditions'], $conditionsAfterJoin);
$queryData['conditions'] = array_merge($queryData['conditions'], $conditionsAfterJoin);
$result = $db->read($this, $queryData, -1);
$path = array_values($path);

View file

@ -89,7 +89,7 @@ class DataSource extends Object {
/**
* Caches/returns cached results for child instances
*
* @param mixed $data
* @param mixed $data Unused in this class.
* @return array Array of sources available in this datasource.
*/
public function listSources($data = null) {
@ -116,7 +116,7 @@ class DataSource extends Object {
/**
* Returns a Model description (metadata) or null if none found.
*
* @param Model|string $model
* @param Model|string $model The model to describe.
* @return array Array of Metadata for the $model
*/
public function describe($model) {
@ -214,7 +214,7 @@ class DataSource extends Object {
* @param Model $Model Instance of the model class being updated
* @param array $fields Array of fields to be updated
* @param array $values Array of values to be update $fields to.
* @param mixed $conditions
* @param mixed $conditions The array of conditions to use.
* @return boolean Success
*/
public function update(Model $Model, $fields = null, $values = null, $conditions = null) {
@ -237,7 +237,7 @@ class DataSource extends Object {
/**
* Returns the ID generated from the previous INSERT operation.
*
* @param mixed $source
* @param mixed $source The source name.
* @return mixed Last ID key generated in previous INSERT
*/
public function lastInsertId($source = null) {
@ -247,7 +247,7 @@ class DataSource extends Object {
/**
* Returns the number of rows returned by last operation.
*
* @param mixed $source
* @param mixed $source The source name.
* @return integer Number of rows returned by last operation
*/
public function lastNumRows($source = null) {
@ -257,7 +257,7 @@ class DataSource extends Object {
/**
* Returns the number of rows affected by last query.
*
* @param mixed $source
* @param mixed $source The source name.
* @return integer Number of rows affected by last query.
*/
public function lastAffected($source = null) {
@ -320,7 +320,7 @@ class DataSource extends Object {
* @param array $data Array of data with values that will be inserted in placeholders.
* @param string $association Name of association model being replaced.
* @param Model $Model Model instance.
* @param array $stack
* @param array $stack The context stack.
* @return mixed String of query data with placeholders replaced, or false on failure.
*/
public function insertQueryData($query, $data, $association, Model $Model, $stack) {

View file

@ -135,7 +135,7 @@ class Sqlite extends DboSource {
/**
* Returns an array of tables in the database. If there are no tables, an error is raised and the application exits.
*
* @param mixed $data
* @param mixed $data Unused.
* @return array Array of table names in the database
*/
public function listSources($data = null) {
@ -202,10 +202,10 @@ class Sqlite extends DboSource {
/**
* Generates and executes an SQL UPDATE statement for given model, fields, and values.
*
* @param Model $model
* @param array $fields
* @param array $values
* @param mixed $conditions
* @param Model $model The model instance to update.
* @param array $fields The fields to update.
* @param array $values The values to set columns to.
* @param mixed $conditions array of conditions to use.
* @return array
*/
public function update(Model $model, $fields = array(), $values = null, $conditions = null) {
@ -287,7 +287,7 @@ class Sqlite extends DboSource {
/**
* Generate ResultSet
*
* @param mixed $results
* @param mixed $results The results to modify.
* @return void
*/
public function resultSet($results) {
@ -297,8 +297,8 @@ class Sqlite extends DboSource {
$index = 0;
$j = 0;
//PDO::getColumnMeta is experimental and does not work with sqlite3,
// so try to figure it out based on the querystring
// PDO::getColumnMeta is experimental and does not work with sqlite3,
// so try to figure it out based on the querystring
$querystring = $results->queryString;
if (stripos($querystring, 'SELECT') === 0) {
$last = strripos($querystring, 'FROM');
@ -448,9 +448,9 @@ class Sqlite extends DboSource {
/**
* Removes redundant primary key indexes, as they are handled in the column def of the key.
*
* @param array $indexes
* @param string $table
* @return string
* @param array $indexes The indexes to build.
* @param string $table The table name.
* @return string The completed index.
*/
public function buildIndex($indexes, $table = null) {
$join = array();
@ -526,8 +526,8 @@ class Sqlite extends DboSource {
/**
* Overrides DboSource::renderStatement to handle schema generation with SQLite-style indexes
*
* @param string $type
* @param array $data
* @param string $type The type of statement being rendered.
* @param array $data The data to convert to SQL.
* @return string
*/
public function renderStatement($type, $data) {

View file

@ -413,8 +413,8 @@ class DboSource extends DataSource {
* - log - Whether or not the query should be logged to the memory log.
*
* @param string $sql SQL statement
* @param array $options
* @param array $params values to be bound to the query
* @param array $options The options for executing the query.
* @param array $params values to be bound to the query.
* @return mixed Resource or object representing the result set, or false on failure
*/
public function execute($sql, $options = array(), $params = array()) {
@ -499,7 +499,7 @@ class DboSource extends DataSource {
* Returns number of affected rows in previous database operation. If no previous operation exists,
* this returns false.
*
* @param mixed $source
* @param mixed $source The source to check.
* @return integer Number of affected rows
*/
public function lastAffected($source = null) {
@ -704,7 +704,7 @@ class DboSource extends DataSource {
/**
* Modifies $result array to place virtual fields in model entry where they belongs to
*
* @param array $result Reference to the fetched row
* @param array &$result Reference to the fetched row
* @return void
*/
public function fetchVirtualField(&$result) {
@ -1166,7 +1166,7 @@ class DboSource extends DataSource {
*
* The primary model is always excluded, because the filtering is later done by Model::_filterResults().
*
* @param array $resultSet Reference of resultset to be filtered.
* @param array &$resultSet Reference of resultset to be filtered.
* @param Model $Model Instance of model to operate against.
* @param array $filtered List of classes already filtered, to be skipped.
* @return array Array of results that have been filtered through $Model->afterFind.
@ -1221,11 +1221,11 @@ class DboSource extends DataSource {
* @param string $type Association type, one of the model association types ie. hasMany.
* @param string $association Association name.
* @param array $assocData Association data.
* @param array $queryData An array of queryData information containing keys similar to Model::find().
* @param array &$queryData An array of queryData information containing keys similar to Model::find().
* @param boolean $external Whether or not the association query is on an external datasource.
* @param array $resultSet Existing results.
* @param array &$resultSet Existing results.
* @param integer $recursive Number of levels of association.
* @param array $stack
* @param array $stack A list with joined models.
* @return mixed
* @throws CakeException when results cannot be created.
*/
@ -1449,7 +1449,7 @@ class DboSource extends DataSource {
*
* Note: this function also deals with the formatting of the data.
*
* @param array $resultSet Data to merge into.
* @param array &$resultSet Data to merge into.
* @param array $assocResultSet Data to merge.
* @param string $association Name of Model being merged.
* @param Model $Model Model being merged onto.
@ -1495,11 +1495,11 @@ class DboSource extends DataSource {
/**
* Merge association of merge into data
*
* @param array $data
* @param array $merge
* @param string $association
* @param string $type
* @param boolean $selfJoin
* @param array &$data The data to merge.
* @param array &$merge The data to merge.
* @param string $association The association name to merge.
* @param string $type The type of association
* @param boolean $selfJoin Whether or not this is a self join.
* @return void
*/
protected function _mergeAssociation(&$data, &$merge, $association, $type, $selfJoin = false) {
@ -1580,7 +1580,7 @@ class DboSource extends DataSource {
*
* When no fields are set, all the $Model fields are returned.
*
* @param Model $Model
* @param Model $Model The model to prepare.
* @param array $queryData An array of queryData information containing keys similar to Model::find().
* @return array Array containing SQL fields.
*/
@ -1609,7 +1609,7 @@ class DboSource extends DataSource {
*
* This is merely a convenient wrapper to DboSource::buildStatement().
*
* @param Model $Model
* @param Model $Model The model to build an association query for.
* @param array $queryData An array of queryData information containing keys similar to Model::find().
* @return string String containing an SQL statement.
* @see DboSource::buildStatement()
@ -1643,7 +1643,7 @@ class DboSource extends DataSource {
* @param string $type Association type, one of the model association types ie. hasMany.
* @param string $association Association name.
* @param array $assocData Association data.
* @param array $queryData An array of queryData information containing keys similar to Model::find().
* @param array &$queryData An array of queryData information containing keys similar to Model::find().
* @param boolean $external Whether or not the association query is on an external datasource.
* @return mixed
* String representing a query.
@ -1913,7 +1913,7 @@ class DboSource extends DataSource {
/**
* Renders a final SQL JOIN statement
*
* @param array $data
* @param array $data The data to generate a join statement for.
* @return string
*/
public function renderJoinStatement($data) {
@ -1969,8 +1969,8 @@ class DboSource extends DataSource {
/**
* Merges a mixed set of string/array conditions.
*
* @param mixed $query
* @param mixed $assoc
* @param mixed $query The query to merge conditions for.
* @param mixed $assoc The association names.
* @return array
*/
protected function _mergeConditions($query, $assoc) {
@ -1999,10 +1999,10 @@ class DboSource extends DataSource {
* Generates and executes an SQL UPDATE statement for given model, fields, and values.
* For databases that do not support aliases in UPDATE queries.
*
* @param Model $Model
* @param array $fields
* @param array $values
* @param mixed $conditions
* @param Model $Model The model to update.
* @param array $fields The fields to update
* @param array $values The values fo the fields.
* @param mixed $conditions The conditions for the update. When non-empty $values will not be quoted.
* @return boolean Success
*/
public function update(Model $Model, $fields = array(), $values = null, $conditions = null) {
@ -2033,8 +2033,8 @@ class DboSource extends DataSource {
/**
* Quotes and prepares fields and values for an SQL UPDATE statement
*
* @param Model $Model
* @param array $fields
* @param Model $Model The model to prepare fields for.
* @param array $fields The fields to update.
* @param boolean $quoteValues If values should be quoted, or treated as SQL snippets
* @param boolean $alias Include the model alias in the field name
* @return array Fields and values, quoted and prepared
@ -2080,8 +2080,8 @@ class DboSource extends DataSource {
* Generates and executes an SQL DELETE statement.
* For databases that do not support aliases in UPDATE queries.
*
* @param Model $Model
* @param mixed $conditions
* @param Model $Model The model to delete from
* @param mixed $conditions The conditions to use. If empty the model's primary key will be used.
* @return boolean Success
*/
public function delete(Model $Model, $conditions = null) {
@ -2104,8 +2104,8 @@ class DboSource extends DataSource {
* Gets a list of record IDs for the given conditions. Used for multi-record updates and deletes
* in databases that do not support aliases in UPDATE/DELETE queries.
*
* @param Model $Model
* @param mixed $conditions
* @param Model $Model The model to find matching records for.
* @param mixed $conditions The conditions to match against.
* @return array List of record IDs
*/
protected function _matchRecords(Model $Model, $conditions = null) {
@ -2154,7 +2154,7 @@ class DboSource extends DataSource {
/**
* Returns an array of SQL JOIN conditions from a model's associations.
*
* @param Model $Model
* @param Model $Model The model to get joins for.2
* @return array
*/
protected function _getJoins(Model $Model) {
@ -2193,7 +2193,7 @@ class DboSource extends DataSource {
/**
* Returns an SQL calculation, i.e. COUNT() or MAX()
*
* @param Model $Model
* @param Model $Model The model to get a calculated field for.
* @param string $func Lowercase name of SQL function, i.e. 'count' or 'max'
* @param array $params Function parameters (any values must be quoted manually)
* @return string An SQL calculation function
@ -2373,7 +2373,7 @@ class DboSource extends DataSource {
/**
* Returns the ID generated from the previous INSERT operation.
*
* @param mixed $source
* @param mixed $source The source to get an id for.
* @return mixed
*/
public function lastInsertId($source = null) {
@ -2385,7 +2385,7 @@ class DboSource extends DataSource {
* If conditions are supplied then they will be returned. If a model doesn't exist and no conditions
* were provided either null or false will be returned based on what was input.
*
* @param Model $Model
* @param Model $Model The model to get conditions for.
* @param string|array|boolean $conditions Array of conditions, conditions string, null or false. If an array of conditions,
* or string conditions those conditions will be returned. With other values the model's existence will be checked.
* If the model doesn't exist a null or false will be returned depending on the input value.
@ -2415,9 +2415,9 @@ class DboSource extends DataSource {
/**
* Returns a key formatted like a string Model.fieldname(i.e. Post.title, or Country.name)
*
* @param Model $Model
* @param string $key
* @param string $assoc
* @param Model $Model The model to get a key for.
* @param string $key The key field.
* @param string $assoc The association name.
* @return string
*/
public function resolveKey(Model $Model, $key, $assoc = null) {
@ -2430,7 +2430,7 @@ class DboSource extends DataSource {
/**
* Private helper method to remove query metadata in given data array.
*
* @param array $data
* @param array $data The data to scrub.
* @return array
*/
protected function _scrubQueryData($data) {
@ -2445,7 +2445,7 @@ class DboSource extends DataSource {
/**
* Converts model virtual fields into sql expressions to be fetched later
*
* @param Model $Model
* @param Model $Model The model to get virtual fields for.
* @param string $alias Alias table name
* @param array $fields virtual fields to be used on query
* @return array
@ -2463,9 +2463,9 @@ class DboSource extends DataSource {
/**
* Generates the fields list of an SQL query.
*
* @param Model $Model
* @param Model $Model The model to get fields for.
* @param string $alias Alias table name
* @param mixed $fields
* @param mixed $fields The provided list of fields.
* @param boolean $quote If false, returns fields array unquoted
* @return array
*/
@ -2833,7 +2833,7 @@ class DboSource extends DataSource {
/**
* Quotes Model.fields
*
* @param string $conditions
* @param string $conditions The conditions to quote.
* @return string or false if no match
*/
protected function _quoteFields($conditions) {
@ -2980,7 +2980,7 @@ class DboSource extends DataSource {
* Create a GROUP BY SQL clause.
*
* @param string|array $fields Group By fields
* @param Model $Model
* @param Model $Model The model to get group by fields for.
* @return string Group By clause or null.
*/
public function group($fields, Model $Model = null) {
@ -3099,7 +3099,7 @@ class DboSource extends DataSource {
* Translates between PHP boolean values and Database (faked) boolean values
*
* @param mixed $data Value to be translated
* @param boolean $quote
* @param boolean $quote Whether or not the field should be cast to a string.
* @return string|boolean Converted boolean value
*/
public function boolean($data, $quote = false) {
@ -3246,10 +3246,10 @@ class DboSource extends DataSource {
}
/**
* Generate a alter syntax from CakeSchema::compare()
* Generate a alter syntax from CakeSchema::compare()
*
* @param mixed $compare
* @param string $table
* @param mixed $compare The comparison data.
* @param string $table The table name.
* @return boolean
*/
public function alterSchema($compare, $table = null) {
@ -3382,8 +3382,8 @@ class DboSource extends DataSource {
/**
* Format indexes for create table.
*
* @param array $indexes
* @param string $table
* @param array $indexes The indexes to build
* @param string $table The table name.
* @return array
*/
public function buildIndex($indexes, $table = null) {
@ -3412,7 +3412,7 @@ class DboSource extends DataSource {
/**
* Read additional table parameters
*
* @param string $name
* @param string $name The table name to read.
* @return array
*/
public function readTableParameters($name) {
@ -3431,8 +3431,8 @@ class DboSource extends DataSource {
/**
* Format parameters for create table
*
* @param array $parameters
* @param string $table
* @param array $parameters The parameters to create SQL for.
* @param string $table The table name.
* @return array
*/
public function buildTableParameters($parameters, $table = null) {
@ -3451,8 +3451,8 @@ class DboSource extends DataSource {
/**
* Guesses the data type of an array
*
* @param string $value
* @return void
* @param string $value The value to introspect for type data.
* @return string
*/
public function introspectType($value) {
if (!is_array($value)) {

View file

@ -314,11 +314,13 @@ class CakeEmail {
/**
* Regex for email validation
* If null, filter_var() will be used.
*
* If null, filter_var() will be used. Use the emailPattern() method
* to set a custom pattern.'
*
* @var string
*/
protected $_emailPattern = null;
protected $_emailPattern = '/^((?:[\p{L}0-9!#$%&\'*+\/=?^_`{|}~-]+)*@[\p{L}0-9-.]+)$/ui';
/**
* The class name used for email configuration.
@ -547,8 +549,8 @@ class CakeEmail {
* @param string $regex for email address validation
* @return string|$this
*/
public function emailPattern($regex = null) {
if ($regex === null) {
public function emailPattern($regex = false) {
if ($regex === false) {
return $this->_emailPattern;
}
$this->_emailPattern = $regex;
@ -593,13 +595,12 @@ class CakeEmail {
* @throws SocketException If email address does not validate
*/
protected function _validateEmail($email) {
$valid = (($this->_emailPattern !== null &&
preg_match($this->_emailPattern, $email)) ||
filter_var($email, FILTER_VALIDATE_EMAIL)
);
if (!$valid) {
throw new SocketException(__d('cake_dev', 'Invalid email: "%s"', $email));
if ($this->_emailPattern === null && filter_var($email, FILTER_VALIDATE_EMAIL)) {
return;
} elseif (preg_match($this->_emailPattern, $email)) {
return;
}
throw new SocketException(__d('cake_dev', 'Invalid email: "%s"', $email));
}
/**

View file

@ -147,4 +147,31 @@ class ConsoleErrorHandlerTest extends CakeTestCase {
$this->Error->handleException($exception);
}
/**
* test a exception with non-integer code
*
* @return void
*/
public function testNonIntegerExceptionCode() {
if (PHP_VERSION_ID < 50300) {
$this->markTestSkipped('ReflectionProperty::setAccessible() is available since 5.3');
}
$exception = new Exception('Non-integer exception code');
$class = new ReflectionClass('Exception');
$property = $class->getProperty('code');
$property->setAccessible(true);
$property->setValue($exception, '42S22');
ConsoleErrorHandler::$stderr->expects($this->once())->method('write')
->with($this->stringContains('Non-integer exception code'));
$this->Error->expects($this->once())
->method('_stop')
->with(1);
$this->Error->handleException($exception);
}
}

View file

@ -249,12 +249,16 @@ class CakeEmailTest extends CakeTestCase {
$this->assertSame($this->CakeEmail->to(), $expected);
$list = array(
'root@localhost' => 'root',
'bjørn@hammeröath.com' => 'Bjorn',
'cake@cakephp.org' => 'Cake PHP',
'cake-php@googlegroups.com' => 'Cake Groups',
'root@cakephp.org'
);
$this->CakeEmail->to($list);
$expected = array(
'root@localhost' => 'root',
'bjørn@hammeröath.com' => 'Bjorn',
'cake@cakephp.org' => 'Cake PHP',
'cake-php@googlegroups.com' => 'Cake Groups',
'root@cakephp.org' => 'root@cakephp.org'
@ -265,6 +269,8 @@ class CakeEmailTest extends CakeTestCase {
$this->CakeEmail->addTo('mark_story@cakephp.org', 'Mark Story');
$result = $this->CakeEmail->addTo(array('phpnut@cakephp.org' => 'PhpNut', 'jose_zap@cakephp.org'));
$expected = array(
'root@localhost' => 'root',
'bjørn@hammeröath.com' => 'Bjorn',
'cake@cakephp.org' => 'Cake PHP',
'cake-php@googlegroups.com' => 'Cake Groups',
'root@cakephp.org' => 'root@cakephp.org',
@ -275,9 +281,6 @@ class CakeEmailTest extends CakeTestCase {
);
$this->assertSame($this->CakeEmail->to(), $expected);
$this->assertSame($this->CakeEmail, $result);
$this->setExpectedException('SocketException');
$this->CakeEmail->to(array('cake@localhost', 'CakePHP'));
}
/**
@ -291,8 +294,6 @@ class CakeEmailTest extends CakeTestCase {
array(''),
array('string'),
array('<tag>'),
array('some@one-whereis'),
array('wrong@key' => 'Name'),
array(array('ok@cakephp.org', 1.0, '', 'string'))
);
}
@ -326,7 +327,6 @@ class CakeEmailTest extends CakeTestCase {
*/
public function testEmailPattern() {
$regex = '/.+@.+\..+/i';
$this->assertNull($this->CakeEmail->emailPattern());
$this->assertSame($regex, $this->CakeEmail->emailPattern($regex)->emailPattern());
}

View file

@ -241,6 +241,7 @@ class InflectorTest extends CakeTestCase {
$this->assertEquals(Inflector::pluralize('curve'), 'curves');
$this->assertEquals(Inflector::pluralize('body_curve'), 'body_curves');
$this->assertEquals(Inflector::pluralize('metadata'), 'metadata');
$this->assertEquals(Inflector::pluralize('stadia'), 'stadia');
$this->assertEquals(Inflector::pluralize(''), '');
}

View file

@ -1434,11 +1434,11 @@ class FormHelperTest extends CakeTestCase {
}
/**
* Test that URL, HTML and identifer show up in their hashs.
* Test that URL, HTML and identifier show up in their hashs.
*
* @return void
*/
public function testSecuredFormUrlHasHtmlAndIdentifer() {
public function testSecuredFormUrlHasHtmlAndIdentifier() {
$this->Form->request['_Token'] = array('key' => 'testKey');
$expected = 'ece0693fb1b19ca116133db1832ac29baaf41ce5%3A';

View file

@ -229,9 +229,7 @@ class CakeFixtureManager {
$db = ConnectionManager::getDataSource($fixture->useDbConfig);
$db->begin();
$this->_setupTable($fixture, $db, $test->dropTables);
if (!$test->dropTables) {
$fixture->truncate($db);
}
$fixture->truncate($db);
$fixture->insert($db);
$db->commit();
}
@ -276,9 +274,7 @@ class CakeFixtureManager {
$db = ConnectionManager::getDataSource($fixture->useDbConfig);
}
$this->_setupTable($fixture, $db, $dropTables);
if (!$dropTables) {
$fixture->truncate($db);
}
$fixture->truncate($db);
$fixture->insert($db);
} else {
throw new UnexpectedValueException(__d('cake_dev', 'Referenced fixture class %s not found', $name));

View file

@ -141,9 +141,9 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* An error occurred.
*
* @param PHPUnit_Framework_Test $test The test to add an error for.
* @param Exception $e The exception object to add.
* @param float $time The current time.
* @param PHPUnit_Framework_Test $test The test to add an error for.
* @param Exception $e The exception object to add.
* @param float $time The current time.
* @return void
*/
public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) {
@ -153,9 +153,9 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* A failure occurred.
*
* @param PHPUnit_Framework_Test $test The test that failed
* @param PHPUnit_Framework_AssertionFailedError $e The assertion that failed.
* @param float $time The current time.
* @param PHPUnit_Framework_Test $test The test that failed
* @param PHPUnit_Framework_AssertionFailedError $e The assertion that failed.
* @param float $time The current time.
* @return void
*/
public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) {
@ -165,9 +165,9 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* Incomplete test.
*
* @param PHPUnit_Framework_Test $test The test that was incomplete.
* @param Exception $e The incomplete exception
* @param float $time The current time.
* @param PHPUnit_Framework_Test $test The test that was incomplete.
* @param Exception $e The incomplete exception
* @param float $time The current time.
* @return void
*/
public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
@ -177,9 +177,9 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* Skipped test.
*
* @param PHPUnit_Framework_Test $test The test that failed.
* @param Exception $e The skip object.
* @param float $time The current time.
* @param PHPUnit_Framework_Test $test The test that failed.
* @param Exception $e The skip object.
* @param float $time The current time.
* @return void
*/
public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
@ -189,7 +189,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* A test suite started.
*
* @param PHPUnit_Framework_TestSuite $suite The suite to start
* @param PHPUnit_Framework_TestSuite $suite The suite to start
* @return void
*/
public function startTestSuite(PHPUnit_Framework_TestSuite $suite) {
@ -202,7 +202,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* A test suite ended.
*
* @param PHPUnit_Framework_TestSuite $suite The suite that ended.
* @param PHPUnit_Framework_TestSuite $suite The suite that ended.
* @return void
*/
public function endTestSuite(PHPUnit_Framework_TestSuite $suite) {
@ -211,7 +211,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* A test started.
*
* @param PHPUnit_Framework_Test $test The test that started.
* @param PHPUnit_Framework_Test $test The test that started.
* @return void
*/
public function startTest(PHPUnit_Framework_Test $test) {
@ -220,8 +220,8 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
/**
* A test ended.
*
* @param PHPUnit_Framework_Test $test The test that ended
* @param float $time The current time.
* @param PHPUnit_Framework_Test $test The test that ended
* @param float $time The current time.
* @return void
*/
public function endTest(PHPUnit_Framework_Test $test, $time) {

View file

@ -56,7 +56,16 @@ class Inflector {
'/$/' => 's',
),
'uninflected' => array(
'.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox', '.*sheep', 'people', 'feedback'
'.*[nrlm]ese',
'.*deer',
'.*fish',
'.*measles',
'.*ois',
'.*pox',
'.*sheep',
'people',
'feedback',
'stadia'
),
'irregular' => array(
'atlas' => 'atlases',