Skip to content

Commit

Permalink
more corrections in order
Browse files Browse the repository at this point in the history
  • Loading branch information
euromark committed Jan 9, 2014
1 parent 3ff23c7 commit 690f54a
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 40 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Core/CakePluginTest.php
Expand Up @@ -210,10 +210,10 @@ public function testLoadNotFound() {
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'));
}

/**
Expand Down
28 changes: 14 additions & 14 deletions lib/Cake/Test/Case/Core/ObjectTest.php
Expand Up @@ -375,62 +375,62 @@ public function testToString() {
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);
}

/**
Expand Down
16 changes: 8 additions & 8 deletions lib/Cake/Test/Case/Model/ModelIntegrationTest.php
Expand Up @@ -1507,8 +1507,8 @@ public function testAutoConstructAssociations() {
'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);
Expand All @@ -1525,8 +1525,8 @@ public function testAutoConstructAssociations() {
'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);
Expand All @@ -1546,8 +1546,8 @@ public function testAutoConstructAssociations() {
'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);
Expand All @@ -1569,8 +1569,8 @@ public function testAutoConstructAssociations() {
'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);
Expand Down
12 changes: 6 additions & 6 deletions lib/Cake/Test/Case/Routing/RouterTest.php
Expand Up @@ -2323,10 +2323,10 @@ public function testGetParams() {
'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();

Expand All @@ -2336,8 +2336,8 @@ public function testGetParams() {
'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));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Utility/HashTest.php
Expand Up @@ -531,7 +531,7 @@ public function testMerge() {
'Validator',
'Transactional'
);
$this->assertEquals(Hash::merge($a, $b), $expected);
$this->assertEquals($expected, Hash::merge($a, $b));
}

/**
Expand Down Expand Up @@ -1461,7 +1461,7 @@ public function testRemoveMulti() {
2 => array('Item' => array('id' => 3, 'title' => 'third')),
4 => array('Item' => array('id' => 5, 'title' => 'fifth')),
);
$this->assertEquals($result, $expected);
$this->assertEquals($expected, $result);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Utility/SetTest.php
Expand Up @@ -182,7 +182,7 @@ public function testMerge() {
$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);
Expand Down Expand Up @@ -1733,7 +1733,7 @@ public function testWritingWithFunkyKeys() {
$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'));
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Utility/StringTest.php
Expand Up @@ -656,7 +656,7 @@ public function testHighlightHtml() {
$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));
}

/**
Expand Down
10 changes: 5 additions & 5 deletions lib/Cake/Test/Case/Utility/XmlTest.php
Expand Up @@ -782,7 +782,7 @@ public function testRss() {
'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(
Expand Down Expand Up @@ -848,7 +848,7 @@ public function testXmlRpc() {
'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(
Expand All @@ -872,7 +872,7 @@ public function testXmlRpc() {
)
)
);
$this->assertSame(Xml::toArray($xml), $expected);
$this->assertSame($expected, Xml::toArray($xml));

$xmlText = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
Expand Down Expand Up @@ -914,7 +914,7 @@ public function testXmlRpc() {
)
)
);
$this->assertSame(Xml::toArray($xml), $expected);
$this->assertSame($expected, Xml::toArray($xml));

$xml = Xml::fromArray($expected, 'tags');
$this->assertXmlStringEqualsXmlString($xmlText, $xml->asXML());
Expand Down Expand Up @@ -1038,7 +1038,7 @@ public function testNamespace() {
);
$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(
Expand Down

0 comments on commit 690f54a

Please sign in to comment.