mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
commit
05b2196cd5
10 changed files with 91 additions and 91 deletions
|
@ -210,10 +210,10 @@ class CakePluginTest extends CakeTestCase {
|
|||
public function testPath() {
|
||||
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
|
||||
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS;
|
||||
$this->assertEquals(CakePlugin::path('TestPlugin'), $expected);
|
||||
$this->assertEquals($expected, CakePlugin::path('TestPlugin'));
|
||||
|
||||
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPluginTwo' . DS;
|
||||
$this->assertEquals(CakePlugin::path('TestPluginTwo'), $expected);
|
||||
$this->assertEquals($expected, CakePlugin::path('TestPluginTwo'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -375,62 +375,62 @@ class ObjectTest extends CakeTestCase {
|
|||
public function testMethodDispatching() {
|
||||
$this->object->emptyMethod();
|
||||
$expected = array('emptyMethod');
|
||||
$this->assertSame($this->object->methodCalls, $expected);
|
||||
$this->assertSame($expected, $this->object->methodCalls);
|
||||
|
||||
$this->object->oneParamMethod('Hello');
|
||||
$expected[] = array('oneParamMethod' => array('Hello'));
|
||||
$this->assertSame($this->object->methodCalls, $expected);
|
||||
$this->assertSame($expected, $this->object->methodCalls);
|
||||
|
||||
$this->object->twoParamMethod(true, false);
|
||||
$expected[] = array('twoParamMethod' => array(true, false));
|
||||
$this->assertSame($this->object->methodCalls, $expected);
|
||||
$this->assertSame($expected, $this->object->methodCalls);
|
||||
|
||||
$this->object->threeParamMethod(true, false, null);
|
||||
$expected[] = array('threeParamMethod' => array(true, false, null));
|
||||
$this->assertSame($this->object->methodCalls, $expected);
|
||||
$this->assertSame($expected, $this->object->methodCalls);
|
||||
|
||||
$this->object->crazyMethod(1, 2, 3, 4, 5, 6, 7);
|
||||
$expected[] = array('crazyMethod' => array(1, 2, 3, 4, 5, 6, 7));
|
||||
$this->assertSame($this->object->methodCalls, $expected);
|
||||
$this->assertSame($expected, $this->object->methodCalls);
|
||||
|
||||
$this->object = new TestObject();
|
||||
$this->assertSame($this->object->methodCalls, array());
|
||||
|
||||
$this->object->dispatchMethod('emptyMethod');
|
||||
$expected = array('emptyMethod');
|
||||
$this->assertSame($this->object->methodCalls, $expected);
|
||||
$this->assertSame($expected, $this->object->methodCalls);
|
||||
|
||||
$this->object->dispatchMethod('oneParamMethod', array('Hello'));
|
||||
$expected[] = array('oneParamMethod' => array('Hello'));
|
||||
$this->assertSame($this->object->methodCalls, $expected);
|
||||
$this->assertSame($expected, $this->object->methodCalls);
|
||||
|
||||
$this->object->dispatchMethod('twoParamMethod', array(true, false));
|
||||
$expected[] = array('twoParamMethod' => array(true, false));
|
||||
$this->assertSame($this->object->methodCalls, $expected);
|
||||
$this->assertSame($expected, $this->object->methodCalls);
|
||||
|
||||
$this->object->dispatchMethod('threeParamMethod', array(true, false, null));
|
||||
$expected[] = array('threeParamMethod' => array(true, false, null));
|
||||
$this->assertSame($this->object->methodCalls, $expected);
|
||||
$this->assertSame($expected, $this->object->methodCalls);
|
||||
|
||||
$this->object->dispatchMethod('fourParamMethod', array(1, 2, 3, 4));
|
||||
$expected[] = array('fourParamMethod' => array(1, 2, 3, 4));
|
||||
$this->assertSame($this->object->methodCalls, $expected);
|
||||
$this->assertSame($expected, $this->object->methodCalls);
|
||||
|
||||
$this->object->dispatchMethod('fiveParamMethod', array(1, 2, 3, 4, 5));
|
||||
$expected[] = array('fiveParamMethod' => array(1, 2, 3, 4, 5));
|
||||
$this->assertSame($this->object->methodCalls, $expected);
|
||||
$this->assertSame($expected, $this->object->methodCalls);
|
||||
|
||||
$this->object->dispatchMethod('crazyMethod', array(1, 2, 3, 4, 5, 6, 7));
|
||||
$expected[] = array('crazyMethod' => array(1, 2, 3, 4, 5, 6, 7));
|
||||
$this->assertSame($this->object->methodCalls, $expected);
|
||||
$this->assertSame($expected, $this->object->methodCalls);
|
||||
|
||||
$this->object->dispatchMethod('methodWithOptionalParam', array('Hello'));
|
||||
$expected[] = array('methodWithOptionalParam' => array("Hello"));
|
||||
$this->assertSame($this->object->methodCalls, $expected);
|
||||
$this->assertSame($expected, $this->object->methodCalls);
|
||||
|
||||
$this->object->dispatchMethod('methodWithOptionalParam');
|
||||
$expected[] = array('methodWithOptionalParam' => array(null));
|
||||
$this->assertSame($this->object->methodCalls, $expected);
|
||||
$this->assertSame($expected, $this->object->methodCalls);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -451,10 +451,10 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
$this->assertEquals($initialCount + 1, $laterCount);
|
||||
|
||||
$children = $this->Tree->children($data[$modelClass]['id'], true, array('name'));
|
||||
$expects = array(array($modelClass => array('name' => '1.1.1')),
|
||||
$expected = array(array($modelClass => array('name' => '1.1.1')),
|
||||
array($modelClass => array('name' => '1.1.2')),
|
||||
array($modelClass => array('name' => 'testAddMiddle')));
|
||||
$this->assertSame($children, $expects);
|
||||
$this->assertSame($expected, $children);
|
||||
|
||||
$validTree = $this->Tree->verify();
|
||||
$this->assertTrue($validTree);
|
||||
|
@ -557,10 +557,10 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
$this->Tree->id = $data[$modelClass]['id'];
|
||||
$this->Tree->saveField($parentField, $parentId);
|
||||
$direct = $this->Tree->children($parentId, true, array('id', 'name', $parentField, $leftField, $rightField));
|
||||
$expects = array(array($modelClass => array('id' => 2, 'name' => '1.1', $parentField => 1, $leftField => 2, $rightField => 5)),
|
||||
$expected = array(array($modelClass => array('id' => 2, 'name' => '1.1', $parentField => 1, $leftField => 2, $rightField => 5)),
|
||||
array($modelClass => array('id' => 5, 'name' => '1.2', $parentField => 1, $leftField => 6, $rightField => 11)),
|
||||
array($modelClass => array('id' => 3, 'name' => '1.1.1', $parentField => 1, $leftField => 12, $rightField => 13)));
|
||||
$this->assertEquals($direct, $expects);
|
||||
$this->assertEquals($expected, $direct);
|
||||
$validTree = $this->Tree->verify();
|
||||
$this->assertTrue($validTree);
|
||||
}
|
||||
|
@ -633,10 +633,10 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
$this->Tree->saveField($parentField, $parentId);
|
||||
|
||||
$result = $this->Tree->children($parentId, true, array('name'));
|
||||
$expects = array(array($modelClass => array('name' => '1.1.1')),
|
||||
$expected = array(array($modelClass => array('name' => '1.1.1')),
|
||||
array($modelClass => array('name' => '1.1.2')),
|
||||
array($modelClass => array('name' => '1.2')));
|
||||
$this->assertEquals($expects, $result);
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$validTree = $this->Tree->verify();
|
||||
$this->assertTrue($validTree);
|
||||
|
@ -662,10 +662,10 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
$this->Tree->saveField($parentField, $parentId);
|
||||
|
||||
$result = $this->Tree->children($parentId, true, array('name'));
|
||||
$expects = array(array($modelClass => array('name' => '1.2.1')),
|
||||
$expected = array(array($modelClass => array('name' => '1.2.1')),
|
||||
array($modelClass => array('name' => '1.2.2')),
|
||||
array($modelClass => array('name' => '1.1')));
|
||||
$this->assertEquals($expects, $result);
|
||||
$this->assertEquals($expected, $result);
|
||||
|
||||
$validTree = $this->Tree->verify();
|
||||
$this->assertTrue($validTree);
|
||||
|
@ -688,7 +688,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
|
||||
$data = $this->Tree->find('first', array('fields' => array('id'), 'conditions' => array($modelClass . '.name' => '1.1.1')));
|
||||
|
||||
$expects = $this->Tree->find('all');
|
||||
$expected = $this->Tree->find('all');
|
||||
$before = $this->Tree->read(null, $data[$modelClass]['id']);
|
||||
|
||||
$this->Tree->id = $parentId;
|
||||
|
@ -697,7 +697,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
$results = $this->Tree->find('all');
|
||||
$after = $this->Tree->read(null, $data[$modelClass]['id']);
|
||||
|
||||
$this->assertEquals($expects, $results);
|
||||
$this->assertEquals($expected, $results);
|
||||
$this->assertEquals($before, $after);
|
||||
|
||||
$validTree = $this->Tree->verify();
|
||||
|
@ -1092,15 +1092,15 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
$this->assertEquals($initialCount, $laterCount);
|
||||
|
||||
$children = $this->Tree->children($result[$modelClass][$parentField], true, array('name'));
|
||||
$expects = array(array($modelClass => array('name' => '1.1.1')),
|
||||
$expected = array(array($modelClass => array('name' => '1.1.1')),
|
||||
array($modelClass => array('name' => '1.1.2')),
|
||||
array($modelClass => array('name' => '1.2')));
|
||||
$this->assertEquals($children, $expects);
|
||||
$this->assertEquals($expected, $children);
|
||||
|
||||
$topNodes = $this->Tree->children(false, true, array('name'));
|
||||
$expects = array(array($modelClass => array('name' => '1. Root')),
|
||||
$expected = array(array($modelClass => array('name' => '1. Root')),
|
||||
array($modelClass => array('name' => '1.1')));
|
||||
$this->assertEquals($topNodes, $expects);
|
||||
$this->assertEquals($expected, $topNodes);
|
||||
|
||||
$validTree = $this->Tree->verify();
|
||||
$this->assertTrue($validTree);
|
||||
|
@ -1130,11 +1130,11 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
$this->assertEquals($initialTopNodes, $laterTopNodes);
|
||||
|
||||
$topNodes = $this->Tree->children(false, true, array('name'));
|
||||
$expects = array(array($modelClass => array('name' => '1.1')),
|
||||
$expected = array(array($modelClass => array('name' => '1.1')),
|
||||
array($modelClass => array('name' => '1.2')),
|
||||
array($modelClass => array('name' => '1. Root')));
|
||||
|
||||
$this->assertEquals($topNodes, $expects);
|
||||
$this->assertEquals($expected, $topNodes);
|
||||
|
||||
$validTree = $this->Tree->verify();
|
||||
$this->assertTrue($validTree);
|
||||
|
@ -1159,7 +1159,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
$this->assertEquals($initialCount, $laterCount);
|
||||
|
||||
$nodes = $this->Tree->find('list', array('order' => $leftField));
|
||||
$expects = array(
|
||||
$expected = array(
|
||||
1 => '1. Root',
|
||||
2 => '1.1',
|
||||
4 => '1.1.2',
|
||||
|
@ -1169,7 +1169,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
3 => '1.1.1',
|
||||
);
|
||||
|
||||
$this->assertEquals($nodes, $expects);
|
||||
$this->assertEquals($expected, $nodes);
|
||||
|
||||
$validTree = $this->Tree->verify();
|
||||
$this->assertTrue($validTree);
|
||||
|
@ -1195,16 +1195,16 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
$this->assertEquals($initialCount - 1, $laterCount);
|
||||
|
||||
$children = $this->Tree->children($result[$modelClass][$parentField], true, array('name'), $leftField . ' asc');
|
||||
$expects = array(
|
||||
$expected = array(
|
||||
array($modelClass => array('name' => '1.1.1')),
|
||||
array($modelClass => array('name' => '1.1.2')),
|
||||
array($modelClass => array('name' => '1.2'))
|
||||
);
|
||||
$this->assertEquals($children, $expects);
|
||||
$this->assertEquals($expected, $children);
|
||||
|
||||
$topNodes = $this->Tree->children(false, true, array('name'));
|
||||
$expects = array(array($modelClass => array('name' => '1. Root')));
|
||||
$this->assertEquals($topNodes, $expects);
|
||||
$expected = array(array($modelClass => array('name' => '1. Root')));
|
||||
$this->assertEquals($expected, $topNodes);
|
||||
|
||||
$validTree = $this->Tree->verify();
|
||||
$this->assertTrue($validTree);
|
||||
|
@ -1229,7 +1229,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
$this->assertEquals($initialCount - 1, $laterCount);
|
||||
|
||||
$nodes = $this->Tree->find('list', array('order' => $leftField));
|
||||
$expects = array(
|
||||
$expected = array(
|
||||
1 => '1. Root',
|
||||
2 => '1.1',
|
||||
4 => '1.1.2',
|
||||
|
@ -1237,7 +1237,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
6 => '1.2.1',
|
||||
7 => '1.2.2',
|
||||
);
|
||||
$this->assertEquals($nodes, $expects);
|
||||
$this->assertEquals($expected, $nodes);
|
||||
|
||||
$validTree = $this->Tree->verify();
|
||||
$this->assertTrue($validTree);
|
||||
|
@ -1258,18 +1258,18 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
$this->Tree->id = $data[$modelClass]['id'];
|
||||
|
||||
$direct = $this->Tree->children(null, true, array('id', 'name', $parentField, $leftField, $rightField));
|
||||
$expects = array(array($modelClass => array('id' => 2, 'name' => '1.1', $parentField => 1, $leftField => 2, $rightField => 7)),
|
||||
$expected = array(array($modelClass => array('id' => 2, 'name' => '1.1', $parentField => 1, $leftField => 2, $rightField => 7)),
|
||||
array($modelClass => array('id' => 5, 'name' => '1.2', $parentField => 1, $leftField => 8, $rightField => 13)));
|
||||
$this->assertEquals($direct, $expects);
|
||||
$this->assertEquals($expected, $direct);
|
||||
|
||||
$total = $this->Tree->children(null, null, array('id', 'name', $parentField, $leftField, $rightField));
|
||||
$expects = array(array($modelClass => array('id' => 2, 'name' => '1.1', $parentField => 1, $leftField => 2, $rightField => 7)),
|
||||
$expected = array(array($modelClass => array('id' => 2, 'name' => '1.1', $parentField => 1, $leftField => 2, $rightField => 7)),
|
||||
array($modelClass => array('id' => 3, 'name' => '1.1.1', $parentField => 2, $leftField => 3, $rightField => 4)),
|
||||
array($modelClass => array('id' => 4, 'name' => '1.1.2', $parentField => 2, $leftField => 5, $rightField => 6)),
|
||||
array($modelClass => array('id' => 5, 'name' => '1.2', $parentField => 1, $leftField => 8, $rightField => 13)),
|
||||
array($modelClass => array('id' => 6, 'name' => '1.2.1', $parentField => 5, $leftField => 9, $rightField => 10)),
|
||||
array($modelClass => array('id' => 7, 'name' => '1.2.2', $parentField => 5, $leftField => 11, $rightField => 12)));
|
||||
$this->assertEquals($total, $expects);
|
||||
$this->assertEquals($expected, $total);
|
||||
|
||||
$this->assertEquals(array(), $this->Tree->children(10000));
|
||||
}
|
||||
|
@ -1315,8 +1315,8 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
$this->Tree->id = $data[$modelClass]['id'];
|
||||
|
||||
$result = $this->Tree->getParentNode(null, array('name'));
|
||||
$expects = array($modelClass => array('name' => '1.2'));
|
||||
$this->assertSame($expects, $result);
|
||||
$expected = array($modelClass => array('name' => '1.2'));
|
||||
$this->assertSame($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1334,10 +1334,10 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
$this->Tree->id = $data[$modelClass]['id'];
|
||||
|
||||
$result = $this->Tree->getPath(null, array('name'));
|
||||
$expects = array(array($modelClass => array('name' => '1. Root')),
|
||||
$expected = array(array($modelClass => array('name' => '1. Root')),
|
||||
array($modelClass => array('name' => '1.2')),
|
||||
array($modelClass => array('name' => '1.2.2')));
|
||||
$this->assertSame($expects, $result);
|
||||
$this->assertSame($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1357,12 +1357,12 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
$this->Tree->id = $data[$modelClass]['id'];
|
||||
|
||||
$direct = $this->Tree->children(null, true, array('id', 'name', $parentField, $leftField, $rightField));
|
||||
$expects = array(array($modelClass => array('id' => 2, 'name' => '1.1', $parentField => 1, $leftField => 2, $rightField => 7)),
|
||||
$expected = array(array($modelClass => array('id' => 2, 'name' => '1.1', $parentField => 1, $leftField => 2, $rightField => 7)),
|
||||
array($modelClass => array('id' => 5, 'name' => '1.2', $parentField => 1, $leftField => 8, $rightField => 13)));
|
||||
$this->assertEquals($direct, $expects);
|
||||
$this->assertEquals($expected, $direct);
|
||||
|
||||
$total = $this->Tree->children(null, null, array('id', 'name', $parentField, $leftField, $rightField));
|
||||
$expects = array(
|
||||
$expected = array(
|
||||
array($modelClass => array('id' => 2, 'name' => '1.1', $parentField => 1, $leftField => 2, $rightField => 7)),
|
||||
array($modelClass => array('id' => 3, 'name' => '1.1.1', $parentField => 2, $leftField => 3, $rightField => 4)),
|
||||
array($modelClass => array('id' => 4, 'name' => '1.1.2', $parentField => 2, $leftField => 5, $rightField => 6)),
|
||||
|
@ -1370,7 +1370,7 @@ class TreeBehaviorNumberTest extends CakeTestCase {
|
|||
array($modelClass => array('id' => 6, 'name' => '1.2.1', $parentField => 5, $leftField => 9, $rightField => 10)),
|
||||
array($modelClass => array('id' => 7, 'name' => '1.2.2', $parentField => 5, $leftField => 11, $rightField => 12))
|
||||
);
|
||||
$this->assertEquals($total, $expects);
|
||||
$this->assertEquals($expected, $total);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -108,10 +108,10 @@ class TreeBehaviorUuidTest extends CakeTestCase {
|
|||
$this->Tree->id = $data[$modelClass]['id'];
|
||||
$this->Tree->saveField($parentField, $parentId);
|
||||
$direct = $this->Tree->children($parentId, true, array('name', $leftField, $rightField));
|
||||
$expects = array(array($modelClass => array('name' => '1.1', $leftField => 2, $rightField => 5)),
|
||||
$expected = array(array($modelClass => array('name' => '1.1', $leftField => 2, $rightField => 5)),
|
||||
array($modelClass => array('name' => '1.2', $leftField => 6, $rightField => 11)),
|
||||
array($modelClass => array('name' => '1.1.1', $leftField => 12, $rightField => 13)));
|
||||
$this->assertEquals($direct, $expects);
|
||||
$this->assertEquals($expected, $direct);
|
||||
$validTree = $this->Tree->verify();
|
||||
$this->assertTrue($validTree);
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ class TreeBehaviorUuidTest extends CakeTestCase {
|
|||
$this->assertEquals($initialCount, $laterCount);
|
||||
|
||||
$nodes = $this->Tree->find('list', array('order' => $leftField));
|
||||
$expects = array(
|
||||
$expected = array(
|
||||
'1. Root',
|
||||
'1.1',
|
||||
'1.1.2',
|
||||
|
@ -173,7 +173,7 @@ class TreeBehaviorUuidTest extends CakeTestCase {
|
|||
'1.1.1',
|
||||
);
|
||||
|
||||
$this->assertEquals(array_values($nodes), $expects);
|
||||
$this->assertEquals($expected, array_values($nodes));
|
||||
|
||||
$validTree = $this->Tree->verify();
|
||||
$this->assertTrue($validTree);
|
||||
|
@ -198,7 +198,7 @@ class TreeBehaviorUuidTest extends CakeTestCase {
|
|||
$this->assertEquals($initialCount - 1, $laterCount);
|
||||
|
||||
$nodes = $this->Tree->find('list', array('order' => $leftField));
|
||||
$expects = array(
|
||||
$expected = array(
|
||||
'1. Root',
|
||||
'1.1',
|
||||
'1.1.2',
|
||||
|
@ -206,7 +206,7 @@ class TreeBehaviorUuidTest extends CakeTestCase {
|
|||
'1.2.1',
|
||||
'1.2.2',
|
||||
);
|
||||
$this->assertEquals(array_values($nodes), $expects);
|
||||
$this->assertEquals($expected, array_values($nodes));
|
||||
|
||||
$validTree = $this->Tree->verify();
|
||||
$this->assertTrue($validTree);
|
||||
|
@ -227,18 +227,18 @@ class TreeBehaviorUuidTest extends CakeTestCase {
|
|||
$this->Tree->id = $data[$modelClass]['id'];
|
||||
|
||||
$direct = $this->Tree->children(null, true, array('name', $leftField, $rightField));
|
||||
$expects = array(array($modelClass => array('name' => '1.1', $leftField => 2, $rightField => 7)),
|
||||
$expected = array(array($modelClass => array('name' => '1.1', $leftField => 2, $rightField => 7)),
|
||||
array($modelClass => array('name' => '1.2', $leftField => 8, $rightField => 13)));
|
||||
$this->assertEquals($direct, $expects);
|
||||
$this->assertEquals($expected, $direct);
|
||||
|
||||
$total = $this->Tree->children(null, null, array('name', $leftField, $rightField));
|
||||
$expects = array(array($modelClass => array('name' => '1.1', $leftField => 2, $rightField => 7)),
|
||||
$expected = array(array($modelClass => array('name' => '1.1', $leftField => 2, $rightField => 7)),
|
||||
array($modelClass => array('name' => '1.1.1', $leftField => 3, $rightField => 4)),
|
||||
array($modelClass => array('name' => '1.1.2', $leftField => 5, $rightField => 6)),
|
||||
array($modelClass => array('name' => '1.2', $leftField => 8, $rightField => 13)),
|
||||
array($modelClass => array('name' => '1.2.1', $leftField => 9, $rightField => 10)),
|
||||
array($modelClass => array('name' => '1.2.2', $leftField => 11, $rightField => 12)));
|
||||
$this->assertEquals($total, $expects);
|
||||
$this->assertEquals($expected, $total);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -262,12 +262,12 @@ class TreeBehaviorUuidTest extends CakeTestCase {
|
|||
$this->Tree->id = $data[$modelClass]['id'];
|
||||
|
||||
$direct = $this->Tree->children(null, true, array('name', $leftField, $rightField));
|
||||
$expects = array(array($modelClass => array('name' => '1.1', $leftField => 2, $rightField => 7)),
|
||||
$expected = array(array($modelClass => array('name' => '1.1', $leftField => 2, $rightField => 7)),
|
||||
array($modelClass => array('name' => '1.2', $leftField => 8, $rightField => 13)));
|
||||
$this->assertEquals($direct, $expects);
|
||||
$this->assertEquals($expected, $direct);
|
||||
|
||||
$total = $this->Tree->children(null, null, array('name', $leftField, $rightField));
|
||||
$expects = array(
|
||||
$expected = array(
|
||||
array($modelClass => array('name' => '1.1', $leftField => 2, $rightField => 7)),
|
||||
array($modelClass => array('name' => '1.1.1', $leftField => 3, $rightField => 4)),
|
||||
array($modelClass => array('name' => '1.1.2', $leftField => 5, $rightField => 6)),
|
||||
|
@ -275,7 +275,7 @@ class TreeBehaviorUuidTest extends CakeTestCase {
|
|||
array($modelClass => array('name' => '1.2.1', $leftField => 9, $rightField => 10)),
|
||||
array($modelClass => array('name' => '1.2.2', $leftField => 11, $rightField => 12))
|
||||
);
|
||||
$this->assertEquals($total, $expects);
|
||||
$this->assertEquals($expected, $total);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -293,6 +293,6 @@ class TreeBehaviorUuidTest extends CakeTestCase {
|
|||
|
||||
$result = $this->Tree->generateTreeList();
|
||||
$expected = array('1. Root', '_1.1', '__1.1.1', '__1.1.2', '_1.2', '__1.2.1', '__1.2.2');
|
||||
$this->assertSame(array_values($result), $expected);
|
||||
$this->assertSame($expected, array_values($result));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1507,8 +1507,8 @@ class ModelIntegrationTest extends BaseModelTest {
|
|||
'conditions' => '', 'fields' => '', 'order' => '', 'counterCache' => ''
|
||||
)
|
||||
);
|
||||
$this->assertSame($TestModel->belongsTo, $expected);
|
||||
$this->assertSame($TestFakeModel->belongsTo, $expected);
|
||||
$this->assertSame($expected, $TestModel->belongsTo);
|
||||
$this->assertSame($expected, $TestFakeModel->belongsTo);
|
||||
|
||||
$this->assertEquals('User', $TestModel->User->name);
|
||||
$this->assertEquals('User', $TestFakeModel->User->name);
|
||||
|
@ -1525,8 +1525,8 @@ class ModelIntegrationTest extends BaseModelTest {
|
|||
'dependent' => ''
|
||||
));
|
||||
|
||||
$this->assertSame($TestModel->hasOne, $expected);
|
||||
$this->assertSame($TestFakeModel->hasOne, $expected);
|
||||
$this->assertSame($expected, $TestModel->hasOne);
|
||||
$this->assertSame($expected, $TestFakeModel->hasOne);
|
||||
|
||||
$this->assertEquals('Featured', $TestModel->Featured->name);
|
||||
$this->assertEquals('Featured', $TestFakeModel->Featured->name);
|
||||
|
@ -1546,8 +1546,8 @@ class ModelIntegrationTest extends BaseModelTest {
|
|||
'counterQuery' => ''
|
||||
));
|
||||
|
||||
$this->assertSame($TestModel->hasMany, $expected);
|
||||
$this->assertSame($TestFakeModel->hasMany, $expected);
|
||||
$this->assertSame($expected, $TestModel->hasMany);
|
||||
$this->assertSame($expected, $TestFakeModel->hasMany);
|
||||
|
||||
$this->assertEquals('Comment', $TestModel->Comment->name);
|
||||
$this->assertEquals('Comment', $TestFakeModel->Comment->name);
|
||||
|
@ -1569,8 +1569,8 @@ class ModelIntegrationTest extends BaseModelTest {
|
|||
'finderQuery' => '',
|
||||
));
|
||||
|
||||
$this->assertSame($TestModel->hasAndBelongsToMany, $expected);
|
||||
$this->assertSame($TestFakeModel->hasAndBelongsToMany, $expected);
|
||||
$this->assertSame($expected, $TestModel->hasAndBelongsToMany);
|
||||
$this->assertSame($expected, $TestFakeModel->hasAndBelongsToMany);
|
||||
|
||||
$this->assertEquals('Tag', $TestModel->Tag->name);
|
||||
$this->assertEquals('Tag', $TestFakeModel->Tag->name);
|
||||
|
|
|
@ -2323,10 +2323,10 @@ class RouterTest extends CakeTestCase {
|
|||
'named' => array(), 'pass' => array(),
|
||||
'param1' => '1', 'param2' => '2',
|
||||
);
|
||||
$this->assertEquals(Router::getParams(), $expected);
|
||||
$this->assertEquals(Router::getParam('controller'), false);
|
||||
$this->assertEquals(Router::getParam('param1'), '1');
|
||||
$this->assertEquals(Router::getParam('param2'), '2');
|
||||
$this->assertEquals($expected, Router::getParams());
|
||||
$this->assertEquals(false, Router::getParam('controller'));
|
||||
$this->assertEquals('1', Router::getParam('param1'));
|
||||
$this->assertEquals('2', Router::getParam('param2'));
|
||||
|
||||
Router::reload();
|
||||
|
||||
|
@ -2336,8 +2336,8 @@ class RouterTest extends CakeTestCase {
|
|||
'plugin' => null, 'controller' => 'pages', 'action' => 'display',
|
||||
'named' => array(), 'pass' => array(),
|
||||
);
|
||||
$this->assertEquals(Router::getParams(), $expected);
|
||||
$this->assertEquals(Router::getParams(true), $expected);
|
||||
$this->assertEquals($expected, Router::getParams());
|
||||
$this->assertEquals($expected, Router::getParams(true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -531,7 +531,7 @@ class HashTest extends CakeTestCase {
|
|||
'Validator',
|
||||
'Transactional'
|
||||
);
|
||||
$this->assertEquals(Hash::merge($a, $b), $expected);
|
||||
$this->assertEquals($expected, Hash::merge($a, $b));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1461,7 +1461,7 @@ class HashTest extends CakeTestCase {
|
|||
2 => array('Item' => array('id' => 3, 'title' => 'third')),
|
||||
4 => array('Item' => array('id' => 5, 'title' => 'fifth')),
|
||||
);
|
||||
$this->assertEquals($result, $expected);
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -182,7 +182,7 @@ class SetTest extends CakeTestCase {
|
|||
$expected = array('users' => array('lisa' => array('id' => 5, 'pw' => 'you-will-never-guess', 'age' => 25, 'pet' => 'dog')), 'cakephp', 'ice-cream', 'chocolate');
|
||||
$this->assertEquals($expected, Set::merge($a, $b, $c));
|
||||
|
||||
$this->assertEquals(Set::merge($a, $b, array(), $c), $expected);
|
||||
$this->assertEquals($expected, Set::merge($a, $b, array(), $c));
|
||||
|
||||
$r = Set::merge($a, $b, $c);
|
||||
$this->assertEquals($expected, $r);
|
||||
|
@ -1733,7 +1733,7 @@ class SetTest extends CakeTestCase {
|
|||
$this->assertFalse(Set::check($set, 'Session Test'));
|
||||
|
||||
$expected = array('Session Test' => array('Test Case' => 'test'));
|
||||
$this->assertEquals(Set::insert(array(), 'Session Test.Test Case', "test"), $expected);
|
||||
$this->assertEquals($expected, Set::insert(array(), 'Session Test.Test Case', "test"));
|
||||
$this->assertTrue(Set::check($expected, 'Session Test.Test Case'));
|
||||
}
|
||||
|
||||
|
|
|
@ -656,7 +656,7 @@ podeís adquirirla.</span></p>
|
|||
$this->assertEquals($this->Text->highlight($text3, array('strong', 'what'), $options), $text3);
|
||||
|
||||
$expected = '<b>What</b> a <b>strong</b> mouse: <img src="what-a-strong-mouse.png" alt="What a strong mouse!" />';
|
||||
$this->assertEquals($this->Text->highlight($text4, array('strong', 'what'), $options), $expected);
|
||||
$this->assertEquals($expected, $this->Text->highlight($text4, array('strong', 'what'), $options));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -782,7 +782,7 @@ XML;
|
|||
'pubDate' => 'Tue, 31 Aug 2010 01:42:00 -0500',
|
||||
'guid' => 'http://bakery.cakephp.org/articles/view/alertpay-automated-sales-via-ipn'
|
||||
);
|
||||
$this->assertSame($rssAsArray['rss']['channel']['item'][1], $expected);
|
||||
$this->assertSame($expected, $rssAsArray['rss']['channel']['item'][1]);
|
||||
|
||||
$rss = array(
|
||||
'rss' => array(
|
||||
|
@ -848,7 +848,7 @@ XML;
|
|||
'params' => ''
|
||||
)
|
||||
);
|
||||
$this->assertSame(Xml::toArray($xml), $expected);
|
||||
$this->assertSame($expected, Xml::toArray($xml));
|
||||
|
||||
$xml = Xml::build('<methodCall><methodName>test</methodName><params><param><value><array><data><value><int>12</int></value><value><string>Egypt</string></value><value><boolean>0</boolean></value><value><int>-31</int></value></data></array></value></param></params></methodCall>');
|
||||
$expected = array(
|
||||
|
@ -872,7 +872,7 @@ XML;
|
|||
)
|
||||
)
|
||||
);
|
||||
$this->assertSame(Xml::toArray($xml), $expected);
|
||||
$this->assertSame($expected, Xml::toArray($xml));
|
||||
|
||||
$xmlText = <<<XML
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
@ -914,7 +914,7 @@ XML;
|
|||
)
|
||||
)
|
||||
);
|
||||
$this->assertSame(Xml::toArray($xml), $expected);
|
||||
$this->assertSame($expected, Xml::toArray($xml));
|
||||
|
||||
$xml = Xml::fromArray($expected, 'tags');
|
||||
$this->assertXmlStringEqualsXmlString($xmlText, $xml->asXML());
|
||||
|
@ -1038,7 +1038,7 @@ XML;
|
|||
);
|
||||
$expected = '<' . '?xml version="1.0" encoding="UTF-8"?><root><ns:attr xmlns:ns="http://cakephp.org">1</ns:attr></root>';
|
||||
$xmlResponse = Xml::fromArray($xml);
|
||||
$this->assertEquals(str_replace(array("\r", "\n"), '', $xmlResponse->asXML()), $expected);
|
||||
$this->assertEquals($expected, str_replace(array("\r", "\n"), '', $xmlResponse->asXML()));
|
||||
|
||||
$xml = array(
|
||||
'root' => array(
|
||||
|
|
Loading…
Reference in a new issue