Browse Source

Skipping tests for features not yet implemented in hhvm

Jose Lorenzo Rodriguez 12 years ago
parent
commit
24adbb3fb1

+ 5 - 1
tests/TestCase/Collection/CollectionTest.php

@@ -73,6 +73,7 @@ class CollectionTest extends TestCase {
  * @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 @@ class CollectionTest extends TestCase {
  * @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 @@ class CollectionTest extends TestCase {
 		$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 @@ class CollectionTest extends TestCase {
  * @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 @@ class CollectionTest extends TestCase {
  * @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]],

+ 1 - 0
tests/TestCase/Collection/Iterator/FilterIteratorTest.php

@@ -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))

+ 3 - 3
tests/TestCase/Collection/Iterator/SortIteratorTest.php

@@ -51,14 +51,14 @@ class SortIteratorTest extends TestCase {
 	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));
 	}