diff --git a/stub/spl.zep b/stub/spl.zep new file mode 100644 index 000000000..2f6b91921 --- /dev/null +++ b/stub/spl.zep @@ -0,0 +1,12 @@ +namespace Stub; + +class Spl +{ + /** + * @issue https://github.com/zephir-lang/zephir/issues/1212 + */ + public static function issue1212(string file) + { + return new \SplFileObject(file); + } +} diff --git a/tests/Extension/SplTest.php b/tests/Extension/SplTest.php new file mode 100644 index 000000000..087b14517 --- /dev/null +++ b/tests/Extension/SplTest.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Extension; + +use PHPUnit\Framework\TestCase; +use Stub\Spl; + +final class SplTest extends TestCase +{ + /** + * @issue https://github.com/zephir-lang/zephir/issues/1212 + */ + public function testIssue1212(): void + { + $this->assertInstanceOf(\SplFileObject::class, Spl::issue1212(__DIR__ . '/../fixtures/class-empty.php')); + } +}