Skip to content
Permalink
Browse files

Adding tests for the two new methods in Collection

  • Loading branch information...
lorenzo committed Dec 26, 2013
1 parent 2ddd2d3 commit b1b24249802dbe8359f091e4cc0ac3f093994259
Showing with 23 additions and 0 deletions.
  1. +23 −0 Cake/Test/TestCase/Utility/CollectionTest.php
@@ -474,4 +474,27 @@ public function testSample() {
$this->assertContains($value, $data);
}
}
/**
* Test toArray method
*
* @return void
*/
public function testToArray() {
$data = [1, 2, 3, 4];
$collection = new Collection($data);
$this->assertEquals($data, $collection->toArray());
}
/**
* Test json enconding
*
* @return void
*/
public function testToJson() {
$data = [1, 2, 3, 4];
$collection = new Collection($data);
$this->assertEquals(json_encode($data), json_encode($collection));
}
}

0 comments on commit b1b2424

Please sign in to comment.
You can’t perform that action at this time.