Skip to content
Permalink
Browse files

Skipping tests for features not yet implemented in hhvm

  • Loading branch information...
lorenzo committed Feb 12, 2014
1 parent 42c2413 commit 24adbb3fb138197ebcf19308a6dc16cb78b2836d
@@ -73,6 +73,7 @@ public function testEeach() {
* @return void
*/
public function testFilterChaining() {
$this->skipIf(defined('HHVM_VERSION'), 'Broken on HHVM');
$items = ['a' => 1, 'b' => 2, 'c' => 3];
$collection = new Collection($items);
$callable = $this->getMock('stdClass', ['__invoke']);
@@ -93,6 +94,7 @@ public function testFilterChaining() {
* @return void
*/
public function testReject() {
$this->skipIf(defined('HHVM_VERSION'), 'Broken on HHVM');
$items = ['a' => 1, 'b' => 2, 'c' => 3];
$collection = new Collection($items);
$result = $collection->reject(function ($v, $k, $items) use ($collection) {
@@ -297,7 +299,7 @@ public function testMax() {
$this->assertEquals(['a' => ['b' => ['c' => 10]]], $collection->max('a.b.c'));
$callback = function($e) {
return sin($e['a']['b']['c']);
return $e['a']['b']['c'] * - 1;
};
$this->assertEquals(['a' => ['b' => ['c' => 4]]], $collection->max($callback));
}
@@ -543,6 +545,7 @@ public function testTake() {
* @return void
*/
public function testMatch() {
$this->skipIf(defined('HHVM_VERSION'), 'Broken on HHVM');
$items = [
['id' => 1, 'name' => 'foo', 'thing' => ['parent_id' => 10]],
['id' => 2, 'name' => 'bar', 'thing' => ['parent_id' => 11]],
@@ -571,6 +574,7 @@ public function testMatch() {
* @return void
*/
public function testFirstMatch() {
$this->skipIf(defined('HHVM_VERSION'), 'Broken on HHVM');
$items = [
['id' => 1, 'name' => 'foo', 'thing' => ['parent_id' => 10]],
['id' => 2, 'name' => 'bar', 'thing' => ['parent_id' => 11]],
@@ -29,6 +29,7 @@ class FilterIteratorTest extends TestCase {
* @return void
*/
public function testFilter() {
$this->skipIf(defined('HHVM_VERSION'), 'Broken on HHVM');
$items = new \ArrayIterator([1, 2, 3]);
$callable = $this->getMock('stdClass', ['__invoke']);
$callable->expects($this->at(0))
@@ -51,14 +51,14 @@ public function testSortNumbersIdentity() {
public function testSortNumbersCustom() {
$items = new ArrayObject([3, 5, 1, 2, 4]);
$callback = function($a) {
return sin($a);
return $a * -1;
};
$sorted = new SortIterator($items, $callback);
$expected = array_combine(range(4, 0), [3, 2, 1, 5, 4]);
$expected = array_combine(range(4, 0), [1, 2, 3, 4, 5]);
$this->assertEquals($expected, iterator_to_array($sorted));
$sorted = new SortIterator($items, $callback, SORT_ASC);
$expected = array_combine(range(4, 0), [5, 4, 2, 1, 3]);
$expected = array_combine(range(4, 0), [5, 4, 3, 2, 1]);
$this->assertEquals($expected, iterator_to_array($sorted));
}

0 comments on commit 24adbb3

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