diff --git a/tests/PhpCollection/Tests/SequenceTest.php b/tests/PhpCollection/Tests/SequenceTest.php index 1d9374e..226de89 100644 --- a/tests/PhpCollection/Tests/SequenceTest.php +++ b/tests/PhpCollection/Tests/SequenceTest.php @@ -293,7 +293,8 @@ public function testMap() $this->seq->add('a'); $this->seq->add('b'); - $newSeq = $this->seq->map(function($elem) { + $self = $this; + $newSeq = $this->seq->map(function($elem) use ($self) { switch ($elem) { case 'a': return 'c'; @@ -302,7 +303,7 @@ public function testMap() return 'd'; default: - $this->fail('Unexpected element.'); + $self->fail('Unexpected element.'); } });