Skip to content

Commit

Permalink
Skipping tests for features not yet implemented in hhvm
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Feb 13, 2014
1 parent 42c2413 commit 24adbb3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion tests/TestCase/Collection/CollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand All @@ -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) {
Expand Down Expand Up @@ -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));
}
Expand Down Expand Up @@ -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]],
Expand Down Expand Up @@ -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]],
Expand Down
1 change: 1 addition & 0 deletions tests/TestCase/Collection/Iterator/FilterIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase/Collection/Iterator/SortIteratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down

0 comments on commit 24adbb3

Please sign in to comment.