📁 File Manager Pro
v10.0.3 | PHP: 8.2.31
Server: LiteSpeed
2026-07-03 15:40:35
📂
/ (Root)
/
home
/
orkouolp
/
web
/
testing.orkobd
/
laravel
/
vendor
/
nette
/
utils
/
tests
/
Utils
📍 /home/orkouolp/web/testing.orkobd/laravel/vendor/nette/utils/tests/Utils
🔄 Refresh
✏️
Editing: SmartObject.unsetProperty.phpt
Writable
<?php /** * Test: Nette\SmartObject properties. */ declare(strict_types=1); use Tester\Assert; require __DIR__ . '/../bootstrap.php'; class TestClass { use Nette\SmartObject; public $foo; } test('', function () { $obj = new TestClass; unset($obj->foo); Assert::false(isset($obj->foo)); // re-set $obj->foo = 'hello'; Assert::same('hello', $obj->foo); }); test('double unset', function () { $obj = new TestClass; unset($obj->foo, $obj->foo); }); test('reading of unset property', function () { Assert::exception(function () { $obj = new TestClass; unset($obj->foo); $val = $obj->foo; }, Nette\MemberAccessException::class, 'Cannot read an undeclared property TestClass::$foo.'); });
💾 Save Changes
❌ Cancel