mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
fix coding standards
This commit is contained in:
parent
27d7e2865e
commit
eadc3a75e5
47 changed files with 161 additions and 163 deletions
|
@ -324,7 +324,7 @@ class AclShell extends AppShell {
|
|||
$this->hr();
|
||||
|
||||
$stack = array();
|
||||
$last = null;
|
||||
$last = null;
|
||||
|
||||
foreach ($nodes as $n) {
|
||||
$stack[] = $n;
|
||||
|
|
|
@ -161,7 +161,7 @@ class ApiShell extends AppShell {
|
|||
* @return void
|
||||
*/
|
||||
public function help() {
|
||||
$head = "Usage: cake api [<type>] <className> [-m <method>]\n";
|
||||
$head = "Usage: cake api [<type>] <className> [-m <method>]\n";
|
||||
$head .= "-----------------------------------------------\n";
|
||||
$head .= "Parameters:\n\n";
|
||||
|
||||
|
|
|
@ -611,7 +611,7 @@ class ExtractTask extends AppShell {
|
|||
* @return string Translation template header
|
||||
*/
|
||||
protected function _writeHeader() {
|
||||
$output = "# LANGUAGE translation of CakePHP Application\n";
|
||||
$output = "# LANGUAGE translation of CakePHP Application\n";
|
||||
$output .= "# Copyright YEAR NAME <EMAIL@ADDRESS>\n";
|
||||
$output .= "#\n";
|
||||
$output .= "#, fuzzy\n";
|
||||
|
|
|
@ -207,7 +207,7 @@ class ViewTask extends BakeTask {
|
|||
$this->Controller->connection = $this->connection;
|
||||
$this->controllerName = $this->Controller->getName();
|
||||
|
||||
$prompt = __d('cake_console', "Would you like bake to build your views interactively?\nWarning: Choosing no will overwrite %s views if it exist.", $this->controllerName);
|
||||
$prompt = __d('cake_console', "Would you like bake to build your views interactively?\nWarning: Choosing no will overwrite %s views if it exist.", $this->controllerName);
|
||||
$interactive = $this->in($prompt, array('y', 'n'), 'n');
|
||||
|
||||
if (strtolower($interactive) == 'n') {
|
||||
|
|
|
@ -273,7 +273,7 @@ class PhpAco {
|
|||
|
||||
foreach ($aco as $i => $node) {
|
||||
if (!isset($tree[$node])) {
|
||||
$tree[$node] = array(
|
||||
$tree[$node] = array(
|
||||
'children' => array(),
|
||||
);
|
||||
}
|
||||
|
@ -519,7 +519,7 @@ class PhpAro {
|
|||
* @param array $alias alias from => to (e.g. Role/13 -> Role/editor)
|
||||
* @return void
|
||||
*/
|
||||
public function addAlias(array $alias) {
|
||||
public function addAlias(array $alias) {
|
||||
$this->aliases = array_merge($this->aliases, $alias);
|
||||
}
|
||||
|
||||
|
|
|
@ -448,7 +448,7 @@ class EmailComponent extends Component {
|
|||
* @return string Stripped value
|
||||
*/
|
||||
protected function _strip($value, $message = false) {
|
||||
$search = '%0a|%0d|Content-(?:Type|Transfer-Encoding)\:';
|
||||
$search = '%0a|%0d|Content-(?:Type|Transfer-Encoding)\:';
|
||||
$search .= '|charset\=|mime-version\:|multipart/mixed|(?:[^a-z]to|b?cc)\:.*';
|
||||
|
||||
if ($message !== true) {
|
||||
|
|
|
@ -507,7 +507,7 @@ class Controller extends Object implements CakeEventListener {
|
|||
$privateAction = (
|
||||
$method->name[0] === '_' ||
|
||||
!$method->isPublic() ||
|
||||
!in_array($method->name, $this->methods)
|
||||
!in_array($method->name, $this->methods)
|
||||
);
|
||||
$prefixes = Router::prefixes();
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
*
|
||||
* @package Cake.Event
|
||||
*/
|
||||
interface CakeEventListener {
|
||||
interface CakeEventListener {
|
||||
|
||||
/**
|
||||
* Returns a list of events this object is implementing. When the class is registered
|
||||
|
|
|
@ -407,7 +407,7 @@ class Postgres extends DboSource {
|
|||
$fields[$i] = $prepend . $this->name($build[0]) . '.' . $this->name($build[1]) . ' AS ' . $this->name($build[0] . '__' . $build[1]);
|
||||
}
|
||||
} else {
|
||||
$fields[$i] = preg_replace_callback('/\(([\s\.\w]+)\)/', array(&$this, '_quoteFunctionField'), $fields[$i]);
|
||||
$fields[$i] = preg_replace_callback('/\(([\s\.\w]+)\)/', array(&$this, '_quoteFunctionField'), $fields[$i]);
|
||||
}
|
||||
$result[] = $fields[$i];
|
||||
}
|
||||
|
|
|
@ -283,7 +283,7 @@ class Sqlserver extends DboSource {
|
|||
|
||||
if (strpos($fields[$i], '.') === false) {
|
||||
$this->_fieldMappings[$alias . '__' . $fields[$i]] = $alias . '.' . $fields[$i];
|
||||
$fieldName = $this->name($alias . '.' . $fields[$i]);
|
||||
$fieldName = $this->name($alias . '.' . $fields[$i]);
|
||||
$fieldAlias = $this->name($alias . '__' . $fields[$i]);
|
||||
} else {
|
||||
$build = explode('.', $fields[$i]);
|
||||
|
|
|
@ -245,7 +245,7 @@ class HttpSocketResponse implements ArrayAccess {
|
|||
$chunkLength = hexdec($hexLength);
|
||||
$chunk = substr($body, 0, $chunkLength);
|
||||
if (!empty($chunkExtensionName)) {
|
||||
// @todo See if there are popular chunk extensions we should implement
|
||||
// @todo See if there are popular chunk extensions we should implement
|
||||
}
|
||||
$decodedBody .= $chunk;
|
||||
if ($chunkLength !== 0) {
|
||||
|
|
|
@ -130,9 +130,9 @@ class Router {
|
|||
array('action' => 'index', 'method' => 'GET', 'id' => false),
|
||||
array('action' => 'view', 'method' => 'GET', 'id' => true),
|
||||
array('action' => 'add', 'method' => 'POST', 'id' => false),
|
||||
array('action' => 'edit', 'method' => 'PUT', 'id' => true),
|
||||
array('action' => 'edit', 'method' => 'PUT', 'id' => true),
|
||||
array('action' => 'delete', 'method' => 'DELETE', 'id' => true),
|
||||
array('action' => 'edit', 'method' => 'POST', 'id' => true)
|
||||
array('action' => 'edit', 'method' => 'POST', 'id' => true)
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
@ -564,7 +564,7 @@ class ShellDispatcherTest extends CakeTestCase {
|
|||
$this->assertEquals('a', $Dispatcher->shiftArgs());
|
||||
$this->assertSame($Dispatcher->args, array('b' => 'c', 'd'));
|
||||
|
||||
$Dispatcher->args = array(0 => 'a', 2 => 'b', 30 => 'c');
|
||||
$Dispatcher->args = array(0 => 'a', 2 => 'b', 30 => 'c');
|
||||
$this->assertEquals('a', $Dispatcher->shiftArgs());
|
||||
$this->assertSame($Dispatcher->args, array(0 => 'b', 1 => 'c'));
|
||||
|
||||
|
|
|
@ -596,13 +596,13 @@ HTMLBLOC;
|
|||
$this->assertEquals($expected, $result);
|
||||
|
||||
$content = '<p>Some HTML content with an <a href="mailto:test@example.com">email link</a>';
|
||||
$result = $this->Controller->EmailTest->strip($content, true);
|
||||
$result = $this->Controller->EmailTest->strip($content, true);
|
||||
$expected = $content;
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$content = '<p>Some HTML content with an ';
|
||||
$content = '<p>Some HTML content with an ';
|
||||
$content .= '<a href="mailto:test@example.com,test2@example.com">email link</a>';
|
||||
$result = $this->Controller->EmailTest->strip($content, true);
|
||||
$result = $this->Controller->EmailTest->strip($content, true);
|
||||
$expected = $content;
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
|
|
@ -302,7 +302,7 @@ class AppTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testListObjects() {
|
||||
$result = App::objects('class', CAKE . 'Routing', false);
|
||||
$result = App::objects('class', CAKE . 'Routing', false);
|
||||
$this->assertTrue(in_array('Dispatcher', $result));
|
||||
$this->assertTrue(in_array('Router', $result));
|
||||
|
||||
|
|
|
@ -260,9 +260,9 @@ class MultibyteTest extends CakeTestCase {
|
|||
7716, 7718, 7720, 7722, 7724, 7726, 7728, 7730, 7732, 7734, 7736, 7738, 7740, 7742, 7744, 7746, 7748, 7750,
|
||||
7752, 7754, 7756, 7758, 7760, 7762, 7764, 7766, 7768, 7770, 7772, 7774, 7776, 7778, 7780, 7782, 7784, 7786,
|
||||
7788, 7790, 7792, 7794, 7796, 7798, 7800, 7802, 7804, 7806, 7808, 7810, 7812, 7814, 7816, 7818, 7820, 7822,
|
||||
7824, 7826, 7828, 7830, 7831, 7832, 7833, 7834, 7840, 7842, 7844, 7846, 7848, 7850, 7852, 7854, 7856,
|
||||
7824, 7826, 7828, 7830, 7831, 7832, 7833, 7834, 7840, 7842, 7844, 7846, 7848, 7850, 7852, 7854, 7856,
|
||||
7858, 7860, 7862, 7864, 7866, 7868, 7870, 7872, 7874, 7876, 7878, 7880, 7882, 7884, 7886, 7888, 7890, 7892,
|
||||
7894, 7896, 7898, 7900, 7902, 7904, 7906, 7908, 7910, 7912, 7914, 7916, 7918, 7920, 7922, 7924, 7926, 7928);
|
||||
7894, 7896, 7898, 7900, 7902, 7904, 7906, 7908, 7910, 7912, 7914, 7916, 7918, 7920, 7922, 7924, 7926, 7928);
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$string = 'ḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕẖẗẘẙẚạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹ';
|
||||
|
@ -579,9 +579,9 @@ class MultibyteTest extends CakeTestCase {
|
|||
7716, 7718, 7720, 7722, 7724, 7726, 7728, 7730, 7732, 7734, 7736, 7738, 7740, 7742, 7744, 7746, 7748, 7750,
|
||||
7752, 7754, 7756, 7758, 7760, 7762, 7764, 7766, 7768, 7770, 7772, 7774, 7776, 7778, 7780, 7782, 7784, 7786,
|
||||
7788, 7790, 7792, 7794, 7796, 7798, 7800, 7802, 7804, 7806, 7808, 7810, 7812, 7814, 7816, 7818, 7820, 7822,
|
||||
7824, 7826, 7828, 7830, 7831, 7832, 7833, 7834, 7840, 7842, 7844, 7846, 7848, 7850, 7852, 7854, 7856,
|
||||
7824, 7826, 7828, 7830, 7831, 7832, 7833, 7834, 7840, 7842, 7844, 7846, 7848, 7850, 7852, 7854, 7856,
|
||||
7858, 7860, 7862, 7864, 7866, 7868, 7870, 7872, 7874, 7876, 7878, 7880, 7882, 7884, 7886, 7888, 7890, 7892,
|
||||
7894, 7896, 7898, 7900, 7902, 7904, 7906, 7908, 7910, 7912, 7914, 7916, 7918, 7920, 7922, 7924, 7926, 7928);
|
||||
7894, 7896, 7898, 7900, 7902, 7904, 7906, 7908, 7910, 7912, 7914, 7916, 7918, 7920, 7922, 7924, 7926, 7928);
|
||||
$result = Multibyte::ascii($input);
|
||||
$expected = 'ḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẖẗẘẙẚẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸ';
|
||||
$this->assertEquals($expected, $result);
|
||||
|
|
|
@ -3028,7 +3028,7 @@ class MysqlTest extends CakeTestCase {
|
|||
'type' => 'timestamp',
|
||||
'default' => 'current_timestamp',
|
||||
'null' => false,
|
||||
);
|
||||
);
|
||||
$result = $this->Dbo->buildColumn($data);
|
||||
$expected = '`created` timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL';
|
||||
$this->assertEquals($expected, $result);
|
||||
|
|
|
@ -1427,7 +1427,7 @@ class ModelIntegrationTest extends BaseModelTest {
|
|||
|
||||
$assocTypes = array('hasMany', 'hasOne', 'belongsTo', 'hasAndBelongsToMany');
|
||||
foreach ($assocTypes as $type) {
|
||||
$this->assertEquals($Article->getAssociated($type), array_keys($Article->{$type}));
|
||||
$this->assertEquals($Article->getAssociated($type), array_keys($Article->{$type}));
|
||||
}
|
||||
|
||||
$Article->bindModel(array('hasMany' => array('Category')));
|
||||
|
|
|
@ -254,7 +254,7 @@ class ModelReadTest extends BaseModelTest {
|
|||
$this->loadFixtures('Article', 'User', 'Tag', 'ArticlesTag', 'Comment', 'Attachment');
|
||||
$Article = new Article();
|
||||
|
||||
$query = 'SELECT title FROM ';
|
||||
$query = 'SELECT title FROM ';
|
||||
$query .= $this->db->fullTableName('articles');
|
||||
$query .= ' WHERE ' . $this->db->fullTableName('articles') . '.id IN (1,2)';
|
||||
|
||||
|
@ -262,7 +262,7 @@ class ModelReadTest extends BaseModelTest {
|
|||
$this->assertTrue(is_array($results));
|
||||
$this->assertEquals(2, count($results));
|
||||
|
||||
$query = 'SELECT title, body FROM ';
|
||||
$query = 'SELECT title, body FROM ';
|
||||
$query .= $this->db->fullTableName('articles');
|
||||
$query .= ' WHERE ' . $this->db->fullTableName('articles') . '.id = 1';
|
||||
|
||||
|
@ -270,7 +270,7 @@ class ModelReadTest extends BaseModelTest {
|
|||
$this->assertFalse($this->db->getQueryCache($query));
|
||||
$this->assertTrue(is_array($results));
|
||||
|
||||
$query = 'SELECT title, id FROM ';
|
||||
$query = 'SELECT title, id FROM ';
|
||||
$query .= $this->db->fullTableName('articles');
|
||||
$query .= ' WHERE ' . $this->db->fullTableName('articles');
|
||||
$query .= '.published = ' . $this->db->value('Y');
|
||||
|
@ -312,7 +312,7 @@ class ModelReadTest extends BaseModelTest {
|
|||
$result = $this->db->getQueryCache($query, $params);
|
||||
$this->assertFalse(empty($result));
|
||||
|
||||
$query = 'SELECT id, created FROM ';
|
||||
$query = 'SELECT id, created FROM ';
|
||||
$query .= $this->db->fullTableName('articles');
|
||||
$query .= ' WHERE ' . $this->db->fullTableName('articles') . '.title = ?';
|
||||
|
||||
|
@ -326,7 +326,7 @@ class ModelReadTest extends BaseModelTest {
|
|||
$result = $this->db->getQueryCache($query, $params);
|
||||
$this->assertTrue(empty($result));
|
||||
|
||||
$query = 'SELECT title FROM ';
|
||||
$query = 'SELECT title FROM ';
|
||||
$query .= $this->db->fullTableName('articles');
|
||||
$query .= ' WHERE ' . $this->db->fullTableName('articles') . '.title LIKE ?';
|
||||
|
||||
|
@ -339,7 +339,7 @@ class ModelReadTest extends BaseModelTest {
|
|||
);
|
||||
|
||||
//related to ticket #5035
|
||||
$query = 'SELECT title FROM ';
|
||||
$query = 'SELECT title FROM ';
|
||||
$query .= $this->db->fullTableName('articles') . ' WHERE title = ? AND published = ?';
|
||||
$params = array('First? Article', 'Y');
|
||||
$Article->query($query, $params);
|
||||
|
@ -359,7 +359,7 @@ class ModelReadTest extends BaseModelTest {
|
|||
$this->loadFixtures('Article', 'User', 'Tag', 'ArticlesTag');
|
||||
$Article = new Article();
|
||||
|
||||
$query = 'SELECT * FROM ' . $this->db->fullTableName('articles');
|
||||
$query = 'SELECT * FROM ' . $this->db->fullTableName('articles');
|
||||
$query .= ' WHERE ' . $this->db->fullTableName('articles');
|
||||
$query .= '.published = ? AND ' . $this->db->fullTableName('articles') . '.user_id = ?';
|
||||
$params = array('Y');
|
||||
|
|
|
@ -6281,8 +6281,8 @@ class ModelWriteTest extends BaseModelTest {
|
|||
'ProductUpdateAll' => array(
|
||||
'id' => 1,
|
||||
'name' => 'product one',
|
||||
'groupcode' => 120,
|
||||
'group_id' => 1),
|
||||
'groupcode' => 120,
|
||||
'group_id' => 1),
|
||||
'Group' => array(
|
||||
'id' => 1,
|
||||
'name' => 'group one',
|
||||
|
@ -6292,7 +6292,7 @@ class ModelWriteTest extends BaseModelTest {
|
|||
'ProductUpdateAll' => array(
|
||||
'id' => 2,
|
||||
'name' => 'product two',
|
||||
'groupcode' => 120,
|
||||
'groupcode' => 120,
|
||||
'group_id' => 1),
|
||||
'Group' => array(
|
||||
'id' => 1,
|
||||
|
@ -6344,9 +6344,9 @@ class ModelWriteTest extends BaseModelTest {
|
|||
'0' => array(
|
||||
'ProductUpdateAll' => array(
|
||||
'id' => 1,
|
||||
'name' => 'new product',
|
||||
'groupcode' => 120,
|
||||
'group_id' => 1),
|
||||
'name' => 'new product',
|
||||
'groupcode' => 120,
|
||||
'group_id' => 1),
|
||||
'Group' => array(
|
||||
'id' => 1,
|
||||
'name' => 'group one',
|
||||
|
@ -6355,9 +6355,9 @@ class ModelWriteTest extends BaseModelTest {
|
|||
'1' => array(
|
||||
'ProductUpdateAll' => array(
|
||||
'id' => 2,
|
||||
'name' => 'new product',
|
||||
'groupcode' => 120,
|
||||
'group_id' => 1),
|
||||
'name' => 'new product',
|
||||
'groupcode' => 120,
|
||||
'group_id' => 1),
|
||||
'Group' => array(
|
||||
'id' => 1,
|
||||
'name' => 'group one',
|
||||
|
@ -6397,9 +6397,9 @@ class ModelWriteTest extends BaseModelTest {
|
|||
'0' => array(
|
||||
'ProductUpdateAll' => array(
|
||||
'id' => 1,
|
||||
'name' => 'new product',
|
||||
'groupcode' => 120,
|
||||
'group_id' => 1),
|
||||
'name' => 'new product',
|
||||
'groupcode' => 120,
|
||||
'group_id' => 1),
|
||||
'Group' => array(
|
||||
'id' => 1,
|
||||
'name' => 'group one',
|
||||
|
@ -6408,9 +6408,9 @@ class ModelWriteTest extends BaseModelTest {
|
|||
'1' => array(
|
||||
'ProductUpdateAll' => array(
|
||||
'id' => 2,
|
||||
'name' => 'new product',
|
||||
'groupcode' => 120,
|
||||
'group_id' => 1),
|
||||
'name' => 'new product',
|
||||
'groupcode' => 120,
|
||||
'group_id' => 1),
|
||||
'Group' => array(
|
||||
'id' => 1,
|
||||
'name' => 'group one',
|
||||
|
|
|
@ -24,7 +24,7 @@ App::uses('CakeValidationSet', 'Model/Validator');
|
|||
*
|
||||
* @package Cake.Test.Case.Model.Validator
|
||||
*/
|
||||
class CakeValidationSetTest extends CakeTestCase {
|
||||
class CakeValidationSetTest extends CakeTestCase {
|
||||
|
||||
/**
|
||||
* testValidate method
|
||||
|
|
|
@ -1337,7 +1337,7 @@ class CakeRequestTest extends CakeTestCase {
|
|||
return array(
|
||||
array(
|
||||
'IIS - No rewrite base path',
|
||||
array(
|
||||
array(
|
||||
'App' => array(
|
||||
'base' => false,
|
||||
'baseUrl' => '/index.php',
|
||||
|
|
|
@ -1772,9 +1772,9 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$newStyleEmail = $this->_getEmailByNewStyleCharset('iso-2022-jp', null);
|
||||
$newStyleHeaders = $newStyleEmail->getHeaders($checkHeaders);
|
||||
|
||||
$this->assertSame($oldStyleHeaders['From'], $newStyleHeaders['From']);
|
||||
$this->assertSame($oldStyleHeaders['To'], $newStyleHeaders['To']);
|
||||
$this->assertSame($oldStyleHeaders['Cc'], $newStyleHeaders['Cc']);
|
||||
$this->assertSame($oldStyleHeaders['From'], $newStyleHeaders['From']);
|
||||
$this->assertSame($oldStyleHeaders['To'], $newStyleHeaders['To']);
|
||||
$this->assertSame($oldStyleHeaders['Cc'], $newStyleHeaders['Cc']);
|
||||
$this->assertSame($oldStyleHeaders['Subject'], $newStyleHeaders['Subject']);
|
||||
|
||||
// Header Charset : UTF-8
|
||||
|
@ -1785,9 +1785,9 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$newStyleEmail = $this->_getEmailByNewStyleCharset('iso-2022-jp', 'utf-8');
|
||||
$newStyleHeaders = $newStyleEmail->getHeaders($checkHeaders);
|
||||
|
||||
$this->assertSame($oldStyleHeaders['From'], $newStyleHeaders['From']);
|
||||
$this->assertSame($oldStyleHeaders['To'], $newStyleHeaders['To']);
|
||||
$this->assertSame($oldStyleHeaders['Cc'], $newStyleHeaders['Cc']);
|
||||
$this->assertSame($oldStyleHeaders['From'], $newStyleHeaders['From']);
|
||||
$this->assertSame($oldStyleHeaders['To'], $newStyleHeaders['To']);
|
||||
$this->assertSame($oldStyleHeaders['Cc'], $newStyleHeaders['Cc']);
|
||||
$this->assertSame($oldStyleHeaders['Subject'], $newStyleHeaders['Subject']);
|
||||
|
||||
// Header Charset : ISO-2022-JP
|
||||
|
@ -1798,9 +1798,9 @@ class CakeEmailTest extends CakeTestCase {
|
|||
$newStyleEmail = $this->_getEmailByNewStyleCharset('utf-8', 'iso-2022-jp');
|
||||
$newStyleHeaders = $newStyleEmail->getHeaders($checkHeaders);
|
||||
|
||||
$this->assertSame($oldStyleHeaders['From'], $newStyleHeaders['From']);
|
||||
$this->assertSame($oldStyleHeaders['To'], $newStyleHeaders['To']);
|
||||
$this->assertSame($oldStyleHeaders['Cc'], $newStyleHeaders['Cc']);
|
||||
$this->assertSame($oldStyleHeaders['From'], $newStyleHeaders['From']);
|
||||
$this->assertSame($oldStyleHeaders['To'], $newStyleHeaders['To']);
|
||||
$this->assertSame($oldStyleHeaders['Cc'], $newStyleHeaders['Cc']);
|
||||
$this->assertSame($oldStyleHeaders['Subject'], $newStyleHeaders['Subject']);
|
||||
}
|
||||
|
||||
|
|
|
@ -221,7 +221,7 @@ class HttpSocketTest extends CakeTestCase {
|
|||
$baseConfig = $this->Socket->config;
|
||||
$this->Socket->expects($this->never())->method('connect');
|
||||
$this->Socket->__construct(array('host' => 'foo-bar'));
|
||||
$baseConfig['host'] = 'foo-bar';
|
||||
$baseConfig['host'] = 'foo-bar';
|
||||
$baseConfig['protocol'] = getprotobyname($baseConfig['protocol']);
|
||||
$this->assertEquals($this->Socket->config, $baseConfig);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ App::uses('Router', 'Routing');
|
|||
*
|
||||
* @package Cake.Test.Case.Routing.Route
|
||||
*/
|
||||
class PluginShortRouteTest extends CakeTestCase {
|
||||
class PluginShortRouteTest extends CakeTestCase {
|
||||
|
||||
/**
|
||||
* setUp method
|
||||
|
|
|
@ -26,7 +26,7 @@ App::uses('Router', 'Routing');
|
|||
*
|
||||
* @package Cake.Test.Case.Routing.Route
|
||||
*/
|
||||
class RedirectRouteTest extends CakeTestCase {
|
||||
class RedirectRouteTest extends CakeTestCase {
|
||||
|
||||
/**
|
||||
* setUp method
|
||||
|
|
|
@ -2578,9 +2578,9 @@ class RouterTest extends CakeTestCase {
|
|||
array('action' => 'index', 'method' => 'GET', 'id' => false),
|
||||
array('action' => 'view', 'method' => 'GET', 'id' => true),
|
||||
array('action' => 'add', 'method' => 'POST', 'id' => false),
|
||||
array('action' => 'edit', 'method' => 'PUT', 'id' => true),
|
||||
array('action' => 'edit', 'method' => 'PUT', 'id' => true),
|
||||
array('action' => 'delete', 'method' => 'DELETE', 'id' => true),
|
||||
array('action' => 'edit', 'method' => 'POST', 'id' => true)
|
||||
array('action' => 'edit', 'method' => 'POST', 'id' => true)
|
||||
);
|
||||
$this->assertEquals($default, $expected);
|
||||
|
||||
|
@ -2588,9 +2588,9 @@ class RouterTest extends CakeTestCase {
|
|||
array('action' => 'index', 'method' => 'GET', 'id' => false),
|
||||
array('action' => 'view', 'method' => 'GET', 'id' => true),
|
||||
array('action' => 'add', 'method' => 'POST', 'id' => false),
|
||||
array('action' => 'edit', 'method' => 'PUT', 'id' => true),
|
||||
array('action' => 'edit', 'method' => 'PUT', 'id' => true),
|
||||
array('action' => 'delete', 'method' => 'DELETE', 'id' => true),
|
||||
array('action' => 'update', 'method' => 'POST', 'id' => true)
|
||||
array('action' => 'update', 'method' => 'POST', 'id' => true)
|
||||
);
|
||||
Router::resourceMap($custom);
|
||||
$this->assertEquals(Router::resourceMap(), $custom);
|
||||
|
|
|
@ -352,7 +352,6 @@ class CakeTestCaseTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testGetMockForModel() {
|
||||
|
||||
$Post = $this->getMockForModel('Post');
|
||||
|
||||
$this->assertInstanceOf('Post', $Post);
|
||||
|
@ -372,7 +371,6 @@ class CakeTestCaseTest extends CakeTestCase {
|
|||
* @return void
|
||||
*/
|
||||
public function testGetMockForModelWithPlugin() {
|
||||
|
||||
$TestPluginComment = $this->getMockForModel('TestPlugin.TestPluginComment');
|
||||
|
||||
$result = ClassRegistry::init('TestPlugin.TestPluginComment');
|
||||
|
|
|
@ -47,7 +47,7 @@ class CakeTestFixtureTestFixture extends CakeTestFixture {
|
|||
* @var array
|
||||
*/
|
||||
public $fields = array(
|
||||
'id' => array('type' => 'integer', 'key' => 'primary'),
|
||||
'id' => array('type' => 'integer', 'key' => 'primary'),
|
||||
'name' => array('type' => 'string', 'length' => '255'),
|
||||
'created' => array('type' => 'datetime')
|
||||
);
|
||||
|
@ -92,7 +92,7 @@ class StringsTestFixture extends CakeTestFixture {
|
|||
* @var array
|
||||
*/
|
||||
public $fields = array(
|
||||
'id' => array('type' => 'integer', 'key' => 'primary'),
|
||||
'id' => array('type' => 'integer', 'key' => 'primary'),
|
||||
'name' => array('type' => 'string', 'length' => '255'),
|
||||
'email' => array('type' => 'string', 'length' => '255'),
|
||||
'age' => array('type' => 'integer', 'default' => 10)
|
||||
|
|
|
@ -135,8 +135,8 @@ class DebuggerTest extends CakeTestCase {
|
|||
'a' => array(
|
||||
'href' => "javascript:void(0);",
|
||||
'onclick' => "preg:/document\.getElementById\('cakeErr[a-z0-9]+\-trace'\)\.style\.display = " .
|
||||
"\(document\.getElementById\('cakeErr[a-z0-9]+\-trace'\)\.style\.display == 'none'" .
|
||||
" \? '' \: 'none'\);/"
|
||||
"\(document\.getElementById\('cakeErr[a-z0-9]+\-trace'\)\.style\.display == 'none'" .
|
||||
" \? '' \: 'none'\);/"
|
||||
),
|
||||
'b' => array(), 'Notice', '/b', ' (8)',
|
||||
));
|
||||
|
@ -165,7 +165,7 @@ class DebuggerTest extends CakeTestCase {
|
|||
|
||||
Debugger::output('xml', array(
|
||||
'error' => '<error><code>{:code}</code><file>{:file}</file><line>{:line}</line>' .
|
||||
'{:description}</error>',
|
||||
'{:description}</error>',
|
||||
'context' => "<context>{:context}</context>",
|
||||
'trace' => "<stack>{:trace}</stack>",
|
||||
));
|
||||
|
@ -217,7 +217,7 @@ class DebuggerTest extends CakeTestCase {
|
|||
|
||||
Debugger::addFormat('js', array(
|
||||
'traceLine' => '{:reference} - <a href="txmt://open?url=file://{:file}' .
|
||||
'&line={:line}">{:path}</a>, line {:line}'
|
||||
'&line={:line}">{:path}</a>, line {:line}'
|
||||
));
|
||||
Debugger::outputAs('js');
|
||||
|
||||
|
@ -226,7 +226,7 @@ class DebuggerTest extends CakeTestCase {
|
|||
|
||||
Debugger::addFormat('xml', array(
|
||||
'error' => '<error><code>{:code}</code><file>{:file}</file><line>{:line}</line>' .
|
||||
'{:description}</error>',
|
||||
'{:description}</error>',
|
||||
));
|
||||
Debugger::outputAs('xml');
|
||||
|
||||
|
|
|
@ -1218,21 +1218,21 @@ class SetTest extends CakeTestCase {
|
|||
|
||||
$nonSequential = array(
|
||||
'User' => array(
|
||||
0 => array('id' => 1),
|
||||
2 => array('id' => 2),
|
||||
6 => array('id' => 3),
|
||||
9 => array('id' => 4),
|
||||
3 => array('id' => 5),
|
||||
0 => array('id' => 1),
|
||||
2 => array('id' => 2),
|
||||
6 => array('id' => 3),
|
||||
9 => array('id' => 4),
|
||||
3 => array('id' => 5),
|
||||
),
|
||||
);
|
||||
|
||||
$nonZero = array(
|
||||
'User' => array(
|
||||
2 => array('id' => 1),
|
||||
4 => array('id' => 2),
|
||||
6 => array('id' => 3),
|
||||
9 => array('id' => 4),
|
||||
3 => array('id' => 5),
|
||||
2 => array('id' => 1),
|
||||
4 => array('id' => 2),
|
||||
6 => array('id' => 3),
|
||||
9 => array('id' => 4),
|
||||
3 => array('id' => 5),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -1690,7 +1690,7 @@ class SetTest extends CakeTestCase {
|
|||
|
||||
$result = Set::remove($a, 'files');
|
||||
$expected = array(
|
||||
'pages' => array('name' => 'page')
|
||||
'pages' => array('name' => 'page')
|
||||
);
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
|
|
@ -933,7 +933,7 @@ class FormHelperTest extends CakeTestCase {
|
|||
$this->Form->request['_Token'] = array('key' => $key);
|
||||
$result = $this->Form->secure($fields);
|
||||
|
||||
$hash = '51e3b55a6edd82020b3f29c9ae200e14bbeb7ee5%3AModel.0.hidden%7CModel.0.valid';
|
||||
$hash = '51e3b55a6edd82020b3f29c9ae200e14bbeb7ee5%3AModel.0.hidden%7CModel.0.valid';
|
||||
$hash .= '%7CModel.1.hidden%7CModel.1.valid';
|
||||
|
||||
$expected = array(
|
||||
|
|
|
@ -319,8 +319,8 @@ class HtmlHelperTest extends CakeTestCase {
|
|||
$this->assertTags($result, $expected);
|
||||
|
||||
$result = $this->Html->link($this->Html->image('../favicon.ico'), '#', array('escape' => false));
|
||||
$expected = array(
|
||||
'a' => array('href' => '#'),
|
||||
$expected = array(
|
||||
'a' => array('href' => '#'),
|
||||
'img' => array('src' => 'img/../favicon.ico', 'alt' => ''),
|
||||
'/a'
|
||||
);
|
||||
|
@ -1871,7 +1871,7 @@ class HtmlHelperTest extends CakeTestCase {
|
|||
array('ul' => array('class' => 'breadcrumb')),
|
||||
'<li',
|
||||
array('a' => array('class' => 'home', 'href' => '/')), 'Home', '/a',
|
||||
array('span' =>array('class' => 'divider')), '-', '/span',
|
||||
array('span' => array('class' => 'divider')), '-', '/span',
|
||||
'/li',
|
||||
'<li',
|
||||
array('a' => array('href' => '/lib')), 'Library', '/a',
|
||||
|
@ -1885,14 +1885,14 @@ class HtmlHelperTest extends CakeTestCase {
|
|||
|
||||
/**
|
||||
* Test GetCrumbList using style of Zurb Foundation.
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testCrumbListZurbStyle() {
|
||||
$this->Html->addCrumb('Home', '#');
|
||||
$this->Html->addCrumb('Features', '#');
|
||||
$this->Html->addCrumb('Gene Splicing', '#');
|
||||
$this->Html->addCrumb('Home', '#');
|
||||
$this->Html->addCrumb('Gene Splicing', '#');
|
||||
$this->Html->addCrumb('Home', '#');
|
||||
$result = $this->Html->getCrumbList(
|
||||
array('class' => 'breadcrumbs', 'firstClass' => false, 'lastClass' => 'current')
|
||||
);
|
||||
|
|
|
@ -315,7 +315,7 @@ class PaginatorHelperTest extends CakeTestCase {
|
|||
Router::reload();
|
||||
Router::parse('/');
|
||||
Router::setRequestInfo(array(
|
||||
array('plugin' => null, 'controller' => 'accounts', 'action' => 'index', 'pass' => array(), 'form' => array(), 'url' => array('url' => 'accounts/', 'mod_rewrite' => 'true'), 'bare' => 0),
|
||||
array('plugin' => null, 'controller' => 'accounts', 'action' => 'index', 'pass' => array(), 'form' => array(), 'url' => array('url' => 'accounts/', 'mod_rewrite' => 'true'), 'bare' => 0),
|
||||
array('base' => '/officespace', 'here' => '/officespace/accounts/', 'webroot' => '/officespace/')
|
||||
));
|
||||
|
||||
|
|
|
@ -743,7 +743,7 @@ class RssHelperTest extends CakeTestCase {
|
|||
|
||||
public function testElementNamespaceWithPrefix() {
|
||||
$item = array(
|
||||
'title' => 'Title',
|
||||
'title' => 'Title',
|
||||
'dc:creator' => 'Alex',
|
||||
'xy:description' => 'descriptive words'
|
||||
);
|
||||
|
|
|
@ -52,11 +52,11 @@ class AcoFixture extends CakeTestFixture {
|
|||
* @var array
|
||||
*/
|
||||
public $records = array(
|
||||
array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 24),
|
||||
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'Controller1', 'lft' => 2, 'rght' => 9),
|
||||
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'action1', 'lft' => 3, 'rght' => 6),
|
||||
array('parent_id' => 3, 'model' => null, 'foreign_key' => null, 'alias' => 'record1', 'lft' => 4, 'rght' => 5),
|
||||
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'action2', 'lft' => 7, 'rght' => 8),
|
||||
array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 24),
|
||||
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'Controller1', 'lft' => 2, 'rght' => 9),
|
||||
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'action1', 'lft' => 3, 'rght' => 6),
|
||||
array('parent_id' => 3, 'model' => null, 'foreign_key' => null, 'alias' => 'record1', 'lft' => 4, 'rght' => 5),
|
||||
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'action2', 'lft' => 7, 'rght' => 8),
|
||||
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'Controller2', 'lft' => 10, 'rght' => 17),
|
||||
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'action1', 'lft' => 11, 'rght' => 14),
|
||||
array('parent_id' => 7, 'model' => null, 'foreign_key' => null, 'alias' => 'record1', 'lft' => 12, 'rght' => 13),
|
||||
|
|
|
@ -52,11 +52,11 @@ class AcoTwoFixture extends CakeTestFixture {
|
|||
* @var array
|
||||
*/
|
||||
public $records = array(
|
||||
array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 20),
|
||||
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'tpsReports','lft' => 2, 'rght' => 9),
|
||||
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'view', 'lft' => 3, 'rght' => 6),
|
||||
array('parent_id' => 3, 'model' => null, 'foreign_key' => null, 'alias' => 'current', 'lft' => 4, 'rght' => 5),
|
||||
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'update', 'lft' => 7, 'rght' => 8),
|
||||
array('parent_id' => null, 'model' => null, 'foreign_key' => null, 'alias' => 'ROOT', 'lft' => 1, 'rght' => 20),
|
||||
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'tpsReports','lft' => 2, 'rght' => 9),
|
||||
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'view', 'lft' => 3, 'rght' => 6),
|
||||
array('parent_id' => 3, 'model' => null, 'foreign_key' => null, 'alias' => 'current', 'lft' => 4, 'rght' => 5),
|
||||
array('parent_id' => 2, 'model' => null, 'foreign_key' => null, 'alias' => 'update', 'lft' => 7, 'rght' => 8),
|
||||
array('parent_id' => 1, 'model' => null, 'foreign_key' => null, 'alias' => 'printers', 'lft' => 10, 'rght' => 19),
|
||||
array('parent_id' => 6, 'model' => null, 'foreign_key' => null, 'alias' => 'print', 'lft' => 11, 'rght' => 14),
|
||||
array('parent_id' => 7, 'model' => null, 'foreign_key' => null, 'alias' => 'lettersize','lft' => 12, 'rght' => 13),
|
||||
|
|
|
@ -52,11 +52,11 @@ class AdFixture extends CakeTestFixture {
|
|||
* @var array
|
||||
*/
|
||||
public $records = array(
|
||||
array('parent_id' => null, 'lft' => 1, 'rght' => 2, 'campaign_id' => 1, 'name' => 'Nordover'),
|
||||
array('parent_id' => null, 'lft' => 3, 'rght' => 4, 'campaign_id' => 1, 'name' => 'Statbergen'),
|
||||
array('parent_id' => null, 'lft' => 5, 'rght' => 6, 'campaign_id' => 1, 'name' => 'Feroy'),
|
||||
array('parent_id' => null, 'lft' => 7, 'rght' => 12, 'campaign_id' => 2, 'name' => 'Newcastle'),
|
||||
array('parent_id' => null, 'lft' => 8, 'rght' => 9, 'campaign_id' => 2, 'name' => 'Dublin'),
|
||||
array('parent_id' => null, 'lft' => 1, 'rght' => 2, 'campaign_id' => 1, 'name' => 'Nordover'),
|
||||
array('parent_id' => null, 'lft' => 3, 'rght' => 4, 'campaign_id' => 1, 'name' => 'Statbergen'),
|
||||
array('parent_id' => null, 'lft' => 5, 'rght' => 6, 'campaign_id' => 1, 'name' => 'Feroy'),
|
||||
array('parent_id' => null, 'lft' => 7, 'rght' => 12, 'campaign_id' => 2, 'name' => 'Newcastle'),
|
||||
array('parent_id' => null, 'lft' => 8, 'rght' => 9, 'campaign_id' => 2, 'name' => 'Dublin'),
|
||||
array('parent_id' => null, 'lft' => 10, 'rght' => 11, 'campaign_id' => 2, 'name' => 'Alborg'),
|
||||
array('parent_id' => null, 'lft' => 13, 'rght' => 14, 'campaign_id' => 3, 'name' => 'New York')
|
||||
);
|
||||
|
|
|
@ -51,11 +51,11 @@ class AfterTreeFixture extends CakeTestFixture {
|
|||
* @var array
|
||||
*/
|
||||
public $records = array(
|
||||
array('parent_id' => null, 'lft' => 1, 'rght' => 2, 'name' => 'One'),
|
||||
array('parent_id' => null, 'lft' => 3, 'rght' => 4, 'name' => 'Two'),
|
||||
array('parent_id' => null, 'lft' => 5, 'rght' => 6, 'name' => 'Three'),
|
||||
array('parent_id' => null, 'lft' => 1, 'rght' => 2, 'name' => 'One'),
|
||||
array('parent_id' => null, 'lft' => 3, 'rght' => 4, 'name' => 'Two'),
|
||||
array('parent_id' => null, 'lft' => 5, 'rght' => 6, 'name' => 'Three'),
|
||||
array('parent_id' => null, 'lft' => 7, 'rght' => 12, 'name' => 'Four'),
|
||||
array('parent_id' => null, 'lft' => 8, 'rght' => 9, 'name' => 'Five'),
|
||||
array('parent_id' => null, 'lft' => 8, 'rght' => 9, 'name' => 'Five'),
|
||||
array('parent_id' => null, 'lft' => 10, 'rght' => 11, 'name' => 'Six'),
|
||||
array('parent_id' => null, 'lft' => 13, 'rght' => 14, 'name' => 'Seven')
|
||||
);
|
||||
|
|
|
@ -56,11 +56,11 @@ class AroTwoFixture extends CakeTestFixture {
|
|||
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '1', 'alias' => 'admin', 'lft' => '2', 'rght' => '5'),
|
||||
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '2', 'alias' => 'managers', 'lft' => '6', 'rght' => '9'),
|
||||
array('parent_id' => 1, 'model' => 'Group', 'foreign_key' => '3', 'alias' => 'users', 'lft' => '10', 'rght' => '19'),
|
||||
array('parent_id' => 2, 'model' => 'User', 'foreign_key' => '1', 'alias' => 'Bobs', 'lft' => '3', 'rght' => '4'),
|
||||
array('parent_id' => 3, 'model' => 'User', 'foreign_key' => '2', 'alias' => 'Lumbergh', 'lft' => '7' , 'rght' => '8'),
|
||||
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '3', 'alias' => 'Samir', 'lft' => '11' , 'rght' => '12'),
|
||||
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '4', 'alias' => 'Micheal', 'lft' => '13', 'rght' => '14'),
|
||||
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '5', 'alias' => 'Peter', 'lft' => '15', 'rght' => '16'),
|
||||
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '6', 'alias' => 'Milton', 'lft' => '17', 'rght' => '18'),
|
||||
array('parent_id' => 2, 'model' => 'User', 'foreign_key' => '1', 'alias' => 'Bobs', 'lft' => '3', 'rght' => '4'),
|
||||
array('parent_id' => 3, 'model' => 'User', 'foreign_key' => '2', 'alias' => 'Lumbergh', 'lft' => '7' , 'rght' => '8'),
|
||||
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '3', 'alias' => 'Samir', 'lft' => '11' , 'rght' => '12'),
|
||||
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '4', 'alias' => 'Micheal', 'lft' => '13', 'rght' => '14'),
|
||||
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '5', 'alias' => 'Peter', 'lft' => '15', 'rght' => '16'),
|
||||
array('parent_id' => 4, 'model' => 'User', 'foreign_key' => '6', 'alias' => 'Milton', 'lft' => '17', 'rght' => '18'),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -52,25 +52,25 @@ class ArosAcoTwoFixture extends CakeTestFixture {
|
|||
* @var array
|
||||
*/
|
||||
public $records = array(
|
||||
array('aro_id' => '1', 'aco_id' => '1', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'),
|
||||
array('aro_id' => '2', 'aco_id' => '1', '_create' => '0', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
||||
array('aro_id' => '3', 'aco_id' => '2', '_create' => '0', '_read' => '1', '_update' => '0', '_delete' => '0'),
|
||||
array('aro_id' => '4', 'aco_id' => '2', '_create' => '1', '_read' => '1', '_update' => '0', '_delete' => '-1'),
|
||||
array('aro_id' => '4', 'aco_id' => '6', '_create' => '1', '_read' => '1', '_update' => '0', '_delete' => '0'),
|
||||
array('aro_id' => '5', 'aco_id' => '1', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
||||
array('aro_id' => '6', 'aco_id' => '3', '_create' => '-1', '_read' => '1', '_update' => '-1', '_delete' => '-1'),
|
||||
array('aro_id' => '6', 'aco_id' => '4', '_create' => '-1', '_read' => '1', '_update' => '-1', '_delete' => '1'),
|
||||
array('aro_id' => '6', 'aco_id' => '6', '_create' => '-1', '_read' => '1', '_update' => '1', '_delete' => '-1'),
|
||||
array('aro_id' => '7', 'aco_id' => '2', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'),
|
||||
array('aro_id' => '7', 'aco_id' => '7', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '0'),
|
||||
array('aro_id' => '7', 'aco_id' => '8', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '0'),
|
||||
array('aro_id' => '7', 'aco_id' => '9', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
||||
array('aro_id' => '7', 'aco_id' => '10', '_create' => '0', '_read' => '0', '_update' => '0', '_delete' => '1'),
|
||||
array('aro_id' => '8', 'aco_id' => '10', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
||||
array('aro_id' => '8', 'aco_id' => '2', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'),
|
||||
array('aro_id' => '9', 'aco_id' => '4', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '-1'),
|
||||
array('aro_id' => '9', 'aco_id' => '9', '_create' => '0', '_read' => '0', '_update' => '1', '_delete' => '1'),
|
||||
array('aro_id' => '10', 'aco_id' => '9', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
||||
array('aro_id' => '10', 'aco_id' => '10', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'),
|
||||
array('aro_id' => '1', 'aco_id' => '1', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'),
|
||||
array('aro_id' => '2', 'aco_id' => '1', '_create' => '0', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
||||
array('aro_id' => '3', 'aco_id' => '2', '_create' => '0', '_read' => '1', '_update' => '0', '_delete' => '0'),
|
||||
array('aro_id' => '4', 'aco_id' => '2', '_create' => '1', '_read' => '1', '_update' => '0', '_delete' => '-1'),
|
||||
array('aro_id' => '4', 'aco_id' => '6', '_create' => '1', '_read' => '1', '_update' => '0', '_delete' => '0'),
|
||||
array('aro_id' => '5', 'aco_id' => '1', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
||||
array('aro_id' => '6', 'aco_id' => '3', '_create' => '-1', '_read' => '1', '_update' => '-1', '_delete' => '-1'),
|
||||
array('aro_id' => '6', 'aco_id' => '4', '_create' => '-1', '_read' => '1', '_update' => '-1', '_delete' => '1'),
|
||||
array('aro_id' => '6', 'aco_id' => '6', '_create' => '-1', '_read' => '1', '_update' => '1', '_delete' => '-1'),
|
||||
array('aro_id' => '7', 'aco_id' => '2', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'),
|
||||
array('aro_id' => '7', 'aco_id' => '7', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '0'),
|
||||
array('aro_id' => '7', 'aco_id' => '8', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '0'),
|
||||
array('aro_id' => '7', 'aco_id' => '9', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
||||
array('aro_id' => '7', 'aco_id' => '10', '_create' => '0', '_read' => '0', '_update' => '0', '_delete' => '1'),
|
||||
array('aro_id' => '8', 'aco_id' => '10', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
||||
array('aro_id' => '8', 'aco_id' => '2', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'),
|
||||
array('aro_id' => '9', 'aco_id' => '4', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '-1'),
|
||||
array('aro_id' => '9', 'aco_id' => '9', '_create' => '0', '_read' => '0', '_update' => '1', '_delete' => '1'),
|
||||
array('aro_id' => '10', 'aco_id' => '9', '_create' => '1', '_read' => '1', '_update' => '1', '_delete' => '1'),
|
||||
array('aro_id' => '10', 'aco_id' => '10', '_create' => '-1', '_read' => '-1', '_update' => '-1', '_delete' => '-1'),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -50,6 +50,6 @@ class AttachmentFixture extends CakeTestFixture {
|
|||
* @var array
|
||||
*/
|
||||
public $records = array(
|
||||
array('comment_id' => 5, 'attachment' => 'attachment.zip', 'created' => '2007-03-18 10:51:23', 'updated' => '2007-03-18 10:53:31')
|
||||
array('comment_id' => 5, 'attachment' => 'attachment.zip', 'created' => '2007-03-18 10:51:23', 'updated' => '2007-03-18 10:53:31')
|
||||
);
|
||||
}
|
||||
|
|
|
@ -34,8 +34,8 @@ class CounterCachePostFixture extends CakeTestFixture {
|
|||
);
|
||||
|
||||
public $records = array(
|
||||
array('id' => 1, 'title' => 'Rock and Roll', 'user_id' => 66, 'published' => false),
|
||||
array('id' => 2, 'title' => 'Music', 'user_id' => 66, 'published' => true),
|
||||
array('id' => 3, 'title' => 'Food', 'user_id' => 301, 'published' => true),
|
||||
array('id' => 1, 'title' => 'Rock and Roll', 'user_id' => 66, 'published' => false),
|
||||
array('id' => 2, 'title' => 'Music', 'user_id' => 66, 'published' => true),
|
||||
array('id' => 3, 'title' => 'Food', 'user_id' => 301, 'published' => true),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -33,8 +33,8 @@ class CounterCachePostNonstandardPrimaryKeyFixture extends CakeTestFixture {
|
|||
);
|
||||
|
||||
public $records = array(
|
||||
array('pid' => 1, 'title' => 'Rock and Roll', 'uid' => 66),
|
||||
array('pid' => 2, 'title' => 'Music', 'uid' => 66),
|
||||
array('pid' => 3, 'title' => 'Food', 'uid' => 301),
|
||||
array('pid' => 1, 'title' => 'Rock and Roll', 'uid' => 66),
|
||||
array('pid' => 2, 'title' => 'Music', 'uid' => 66),
|
||||
array('pid' => 3, 'title' => 'Food', 'uid' => 301),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -23,29 +23,29 @@
|
|||
// Roles
|
||||
// -------------------------------------
|
||||
$config['roles'] = array(
|
||||
'Role/admin' => null,
|
||||
'Role/data_acquirer' => null,
|
||||
'Role/accounting' => null,
|
||||
'Role/admin' => null,
|
||||
'Role/data_acquirer' => null,
|
||||
'Role/accounting' => null,
|
||||
'Role/database_manager' => null,
|
||||
'Role/sales' => null,
|
||||
'Role/data_analyst' => 'Role/data_acquirer, Role/database_manager',
|
||||
'Role/reports' => 'Role/data_analyst',
|
||||
'Role/sales' => null,
|
||||
'Role/data_analyst' => 'Role/data_acquirer, Role/database_manager',
|
||||
'Role/reports' => 'Role/data_analyst',
|
||||
// allow inherited roles to be defined as an array or comma separated list
|
||||
'Role/manager' => array(
|
||||
'Role/manager' => array(
|
||||
'Role/accounting',
|
||||
'Role/sales',
|
||||
),
|
||||
'Role/accounting_manager' => 'Role/accounting',
|
||||
'Role/accounting_manager' => 'Role/accounting',
|
||||
// managers
|
||||
'User/hardy' => 'Role/accounting_manager, Role/reports',
|
||||
'User/stan' => 'Role/manager',
|
||||
'User/stan' => 'Role/manager',
|
||||
// accountants
|
||||
'User/peter' => 'Role/accounting',
|
||||
'User/jeff' => 'Role/accounting',
|
||||
'User/peter' => 'Role/accounting',
|
||||
'User/jeff' => 'Role/accounting',
|
||||
// admins
|
||||
'User/jan' => 'Role/admin',
|
||||
// database
|
||||
'User/db_manager_1' => 'Role/database_manager',
|
||||
'User/db_manager_1' => 'Role/database_manager',
|
||||
'User/db_manager_2' => 'Role/database_manager',
|
||||
);
|
||||
|
||||
|
@ -66,9 +66,9 @@ $config['rules']['allow'] = array(
|
|||
);
|
||||
$config['rules']['deny'] = array(
|
||||
// accountants and sales should not delete anything
|
||||
'/controllers/*/delete' => array(
|
||||
'/controllers/*/delete' => array(
|
||||
'Role/sales',
|
||||
'Role/accounting'
|
||||
),
|
||||
'/controllers/db/drop' => 'User/db_manager_2',
|
||||
'/controllers/db/drop' => 'User/db_manager_2',
|
||||
);
|
||||
|
|
|
@ -394,7 +394,7 @@ abstract class CakeTestCase extends PHPUnit_Framework_TestCase {
|
|||
}
|
||||
$regex[] = array(
|
||||
sprintf('%sClose %s tag', $prefix[0], substr($tags, strlen($match[0]))),
|
||||
sprintf('%s<[\s]*\/[\s]*%s[\s]*>[\n\r]*', $prefix[1], substr($tags, strlen($match[0]))),
|
||||
sprintf('%s<[\s]*\/[\s]*%s[\s]*>[\n\r]*', $prefix[1], substr($tags, strlen($match[0]))),
|
||||
$i,
|
||||
);
|
||||
continue;
|
||||
|
@ -689,7 +689,7 @@ abstract class CakeTestCase extends PHPUnit_Framework_TestCase {
|
|||
}
|
||||
|
||||
list($plugin, $name) = pluginSplit($model);
|
||||
$config = array_merge((array) $config, array('name' => $name));
|
||||
$config = array_merge((array)$config, array('name' => $name));
|
||||
$mock = $this->getMock($name, $methods, array($config));
|
||||
ClassRegistry::removeObject($name);
|
||||
ClassRegistry::addObject($name, $mock);
|
||||
|
|
|
@ -133,7 +133,7 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command {
|
|||
* @return CakeTestRunner
|
||||
*/
|
||||
public function getRunner($loader) {
|
||||
return new CakeTestRunner($loader, $this->_params);
|
||||
return new CakeTestRunner($loader, $this->_params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue