Skip to content

Commit

Permalink
Added test for #1775
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyklay committed Feb 21, 2019
1 parent 664654c commit 31b9a29
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
[#1779](https://github.com/phalcon/zephir/issues/1779)
- Use namespace as a prefix for ini name [#1604](https://github.com/phalcon/zephir/issues/1604)
- Fixed calling anonymous functions by resolving context [#1751](https://github.com/phalcon/zephir/issues/1751)
- Fixed a bug when accessing super-global variables that do not exist [#1775](https://github.com/phalcon/zephir/issues/1775)

## [0.11.9] - 2019-01-15
- Fixed `zend_closure` declaration to reflect PHP 7.3 changes
Expand Down
18 changes: 18 additions & 0 deletions unit-tests/Extension/Globals/SessionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Extension\Globals;

use PHPUnit\Framework\TestCase;
use Test\Globals\Session\Base;
use Test\Globals\Session\Child;

class SessionTest extends TestCase
Expand Down Expand Up @@ -81,4 +82,21 @@ public function removeFromUnset()

$this->assertSame([], $_SESSION);
}

/**
* @test
* @see https://github.com/phalcon/zephir/issues/1775
*/
public function shouldAccessToTheSession()
{
unset($_SESSION);
$this->assertFalse(isset($_SESSION));

$t = new Base();
$t->set('foo', 'bar');

$this->assertTrue(isset($_SESSION));
/** @noinspection PhpUndefinedVariableInspection */
$this->assertSame(['foo' => 'bar'], $_SESSION);
}
}

0 comments on commit 31b9a29

Please sign in to comment.