Skip to content

Commit

Permalink
Merge pull request #2195 from zephir-lang/#1212-add-test-case
Browse files Browse the repository at this point in the history
#1212 - Add test case
  • Loading branch information
AlexNDRmac authored Apr 6, 2021
2 parents 3053aa8 + 95e1e88 commit 55e8c66
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
12 changes: 12 additions & 0 deletions stub/spl.zep
Original file line number Diff line number Diff line change
@@ -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);
}
}
28 changes: 28 additions & 0 deletions tests/Extension/SplTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* This file is part of the Zephir.
*
* (c) Phalcon Team <[email protected]>
*
* 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'));
}
}

0 comments on commit 55e8c66

Please sign in to comment.