Skip to content

Commit

Permalink
Ignore the remaining errors.
Browse files Browse the repository at this point in the history
They are just part of the test to compare objects + arrays.
No need to cause standards errors.
  • Loading branch information
markstory committed Mar 20, 2012
1 parent 091ad53 commit edd54e4
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions lib/Cake/Test/Case/Utility/SetTest.php
Expand Up @@ -2190,6 +2190,7 @@ public function testMapReverse() {
array('id' => 1, 'article_id' => 1, 'user_id' => 1, 'comment' => 'First Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:47:23', 'updated' => '2007-03-18 10:49:31'),
array('id' => 2, 'article_id' => 1, 'user_id' => 2, 'comment' => 'Second Comment for First Article', 'published' => 'Y', 'created' => '2007-03-18 10:47:23', 'updated' => '2007-03-18 10:49:31'))));

// @codingStandardsIgnoreStart
$class = new stdClass;
$class->User = new stdClass;
$class->User->psword = 'whatever';
Expand All @@ -2215,6 +2216,7 @@ public function testMapReverse() {
$comment2->published = 'Y';
$comment2->created = '2007-03-18 10:47:23';
$comment2->updated = '2007-03-18 10:49:31';
// @codingStandardsIgnoreEnd
$class->User->Comment = array($comment, $comment2);
$result = Set::reverse($class);
$this->assertEquals($expected, $result);
Expand All @@ -2234,13 +2236,15 @@ public function testMapReverse() {
);
$this->assertEquals($expected, $result);

// @codingStandardsIgnoreStart
$class = new stdClass;
$class->User = new stdClass;
$class->User->id = 100;
$class->User->_name_ = 'User';
$class->Profile = new stdClass;
$class->Profile->name = 'Joe Mamma';
$class->Profile->_name_ = 'Profile';
// @codingStandardsIgnoreEnd

$result = Set::reverse($class);
$expected = array('User' => array('id' => '100'), 'Profile' => array('name' => 'Joe Mamma'));
Expand Down Expand Up @@ -2469,6 +2473,7 @@ public function testMapNesting() {
);
$mapped = Set::map($data);

// @codingStandardsIgnoreStart
$expected = new stdClass();
$expected->_name_ = 'IndexedPage';
$expected->id = 2;
Expand All @@ -2478,6 +2483,7 @@ public function testMapNesting() {
$expected->redirect = '';
$expected->created = "1195055503";
$expected->updated = "1195055503";
// @codingStandardsIgnoreEnd
$this->assertEquals($mapped[1], $expected);

$ids = array();
Expand Down Expand Up @@ -2509,6 +2515,7 @@ public function testNestedMappedData() {
)
));

// @codingStandardsIgnoreStart
$expected = new stdClass;
$expected->_name_ = 'Post';
$expected->id = '1';
Expand Down Expand Up @@ -2546,6 +2553,7 @@ public function testNestedMappedData() {
$expected2->Author->updated = "2007-03-17 01:22:31";
$expected2->Author->test = "working";
$expected2->Author->_name_ = 'Author';
// @codingStandardsIgnoreEnd

$test = array();
$test[0] = $expected;
Expand All @@ -2554,11 +2562,12 @@ public function testNestedMappedData() {
$this->assertEquals($test, $result);

$result = Set::map(
array(
'Post' => array('id' => '1', 'author_id' => '1', 'title' => 'First Post', 'body' => 'First Post Body', 'published' => 'Y', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'),
'Author' => array('id' => '1', 'user' => 'mariano', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:16:23', 'updated' => '2007-03-17 01:18:31', 'test' => 'working'),
)
);
array(
'Post' => array('id' => '1', 'author_id' => '1', 'title' => 'First Post', 'body' => 'First Post Body', 'published' => 'Y', 'created' => '2007-03-18 10:39:23', 'updated' => '2007-03-18 10:41:31'),
'Author' => array('id' => '1', 'user' => 'mariano', 'password' => '5f4dcc3b5aa765d61d8327deb882cf99', 'created' => '2007-03-17 01:16:23', 'updated' => '2007-03-17 01:18:31', 'test' => 'working'),
)
);
// @codingStandardsIgnoreStart
$expected = new stdClass;
$expected->_name_ = 'Post';
$expected->id = '1';
Expand All @@ -2577,6 +2586,7 @@ public function testNestedMappedData() {
$expected->Author->updated = "2007-03-17 01:18:31";
$expected->Author->test = "working";
$expected->Author->_name_ = 'Author';
// @codingStandardsIgnoreEnd
$this->assertEquals($expected, $result);

//Case where extra HABTM fields come back in a result
Expand Down Expand Up @@ -2617,6 +2627,7 @@ public function testNestedMappedData() {

$result = Set::map($data);

// @codingStandardsIgnoreStart
$expected = new stdClass();
$expected->_name_ = 'User';
$expected->id = 1;
Expand Down Expand Up @@ -2653,6 +2664,7 @@ public function testNestedMappedData() {
$piece2->PiecesUser->_name_ = 'PiecesUser';

$piece2->_name_ = 'Piece';
// @codingStandardsIgnoreEnd

$expected->Piece = array($piece, $piece2);

Expand Down Expand Up @@ -2701,6 +2713,7 @@ public function testNestedMappedData() {

$result = Set::map($data);

// @codingStandardsIgnoreStart
$expected = new stdClass();
$expected->_name_ = 'FooUser';
$expected->id = 1;
Expand Down Expand Up @@ -2733,6 +2746,7 @@ public function testNestedMappedData() {
$piece2->PiecesUser->piece_id = 2;
$piece2->PiecesUser->user_id = 2;
$piece2->PiecesUser->_name_ = 'FooPiecesUser';
// @codingStandardsIgnoreEnd

$expected->Piece = array($piece, $piece2);

Expand Down

0 comments on commit edd54e4

Please sign in to comment.