Skip to content

Commit

Permalink
#1873 - Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Apr 8, 2021
1 parent 93ed12f commit 034cd48
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions stub/closures.zep
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Closures
{
protected _argument;
protected _function;
protected property1873 = "call from closure";

public function simple1()
{
Expand Down Expand Up @@ -97,4 +98,11 @@ class Closures
{
return call_user_func(this->_function, this->_argument);
}

public function issue1873() -> string
{
return function () {
return this->property1873;
};
}
}
7 changes: 7 additions & 0 deletions tests/Extension/ClosureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ public function testIssue1036(): void

$this->assertTrue($test->issue1036Call());
}

public function testIssue1873(): void
{
$test = new Closures();

$this->assertInstanceOf(\Closure::class, $test->issue1873());
}
}

0 comments on commit 034cd48

Please sign in to comment.