Skip to content

Commit

Permalink
Merge pull request #2202 from zephir-lang/#1136-add-test-case
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexNDRmac authored Apr 8, 2021
2 parents 2a3baf7 + fafd17b commit 93ed12f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
16 changes: 16 additions & 0 deletions stub/mcall.zep
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,20 @@ class Mcall
let a = new self;
return a->bb();
}

/**
* @issue https://github.com/zephir-lang/zephir/issues/1136
*/
public function issue1136()
{
var _finfo;

if version_compare(PHP_VERSION, "8.0.0", ">=") {
let _finfo = new \finfo();
} else {
let _finfo = finfo_open();
}

return _finfo;
}
}
14 changes: 14 additions & 0 deletions tests/Extension/MCallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,18 @@ public function testShouldThrowTypeErrorForOptionalBoolean2(): void

$test->optionalParameterBoolean([]);
}

/**
* @issue https://github.com/zephir-lang/zephir/issues/1136
*/
public function testIssue1136(): void
{
$test = new Mcall();

if (version_compare(PHP_VERSION, "8.0.0", ">=")) {
$this->assertInstanceOf(\finfo::class, $test->issue1136());
} else {
$this->assertIsResource($test->issue1136());
}
}
}

0 comments on commit 93ed12f

Please sign in to comment.