mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
first
This commit is contained in:
19
tests/Unit/Support/Reflection.php
Normal file
19
tests/Unit/Support/Reflection.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use Pest\Support\Reflection;
|
||||
|
||||
it('gets file name from closure', function () {
|
||||
$fileName = Reflection::getFileNameFromClosure(function () {});
|
||||
|
||||
assertEquals(__FILE__, $fileName);
|
||||
});
|
||||
|
||||
it('gets property values', function () {
|
||||
$class = new class() {
|
||||
private $foo = 'bar';
|
||||
};
|
||||
|
||||
$value = Reflection::getPropertyValue($class, 'foo');
|
||||
|
||||
assertEquals('bar', $value);
|
||||
});
|
||||
Reference in New Issue
Block a user