Pinq\Tests\Integration\Traversable\GroupJoinTest::testCalledWithCorrectValueAndKeyParameters PHP 메소드

testCalledWithCorrectValueAndKeyParameters() 공개 메소드

public testCalledWithCorrectValueAndKeyParameters ( Pinq\ITraversable $traversable, array $data )
$traversable Pinq\ITraversable
$data array
    public function testCalledWithCorrectValueAndKeyParameters(\Pinq\ITraversable $traversable, array $data)
    {
        $traversable->groupJoin([0 => 0])->on(function ($outer, $inner, $outerKey, $innerKey) use($data) {
            $this->assertSame($data[$outerKey], $outer);
            $this->assertSame($inner, 0);
            $this->assertSame($innerKey, 0);
            return true;
        })->to(function ($outer, \Pinq\ITraversable $group, $outerKey, $groupKey) use($data) {
            $this->assertSame($data[$outerKey], $outer);
            $this->assertSame($group->asArray(), [0 => 0]);
            $this->assertSame($groupKey, 0);
        })->asArray();
        $traversable->groupJoin([0 => 0])->onEquality(function ($outer, $outerKey) use($data) {
            $this->assertSame($data[$outerKey], $outer);
            return 'group Key';
        }, function ($inner, $innerKey) {
            $this->assertSame($inner, 0);
            $this->assertSame($innerKey, 0);
            return 'group Key';
        })->to(function ($outer, \Pinq\ITraversable $group, $outerKey, $groupKey) use($data) {
            $this->assertSame($data[$outerKey], $outer);
            $this->assertSame($group->asArray(), [0 => 0]);
            $this->assertSame($groupKey, 'group Key');
        })->asArray();
    }