Permalink
Browse files

more corrections in order

  • Loading branch information...
1 parent 3ff23c7 commit 690f54ad9d227604753467c7874ea5e899fa9ea3 @dereuromark dereuromark committed Jan 9, 2014
View
4 lib/Cake/Test/Case/Core/CakePluginTest.php
@@ -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'));
}
/**
View
28 lib/Cake/Test/Case/Core/ObjectTest.php
@@ -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);
}
/**
View
16 lib/Cake/Test/Case/Model/ModelIntegrationTest.php
@@ -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);
@@ -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);
@@ -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);
@@ -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);
View
12 lib/Cake/Test/Case/Routing/RouterTest.php
@@ -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();
@@ -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));
}
/**
View
4 lib/Cake/Test/Case/Utility/HashTest.php
@@ -531,7 +531,7 @@ public function testMerge() {
'Validator',
'Transactional'
);
- $this->assertEquals(Hash::merge($a, $b), $expected);
+ $this->assertEquals($expected, Hash::merge($a, $b));
}
/**
@@ -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);
}
/**
View
4 lib/Cake/Test/Case/Utility/SetTest.php
@@ -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);
@@ -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'));
}
View
2 lib/Cake/Test/Case/Utility/StringTest.php
@@ -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));
}
/**
View
10 lib/Cake/Test/Case/Utility/XmlTest.php
@@ -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(
@@ -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(
@@ -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"?>
@@ -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());
@@ -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(

0 comments on commit 690f54a

Please sign in to comment.