Skip to content

Commit

Permalink
Test - Add OO test for intersect()
Browse files Browse the repository at this point in the history
  • Loading branch information
brianhaveri committed May 31, 2011
1 parent 33261a8 commit 3131ed6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions test/ArraysTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,11 @@ public function testIntersect() {
$leaders = array('moe', 'groucho');
$this->assertEquals(array('moe'), _::intersect($stooges, $leaders), 'can take the set intersection of two arrays');

// @todo
/*
equals(_(stooges).intersect(leaders).join(''), 'moe', 'can perform an OO-style intersection');
var result = (function(){ return _.intersect(arguments, leaders); })('moe', 'curly', 'larry');
equals(result.join(''), 'moe', 'works on an arguments object');
*/
$this->assertEquals(array('moe'), _($stooges)->intersect($leaders), 'can perform an OO-style intersection');

$func = function() use ($leaders) { $args = func_get_args(); return _::intersect($args[0], $leaders); };
$result = $func($stooges);
$this->assertEquals(array('moe'), $result, 'works on an arguments object');
}

public function testZip() {
Expand Down

0 comments on commit 3131ed6

Please sign in to comment.