mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
22 lines
409 B
PHP
22 lines
409 B
PHP
<?php
|
|
|
|
use Pest\Support\Reflection;
|
|
|
|
it('gets file name from closure', function () {
|
|
$fileName = Reflection::getFileNameFromClosure(function () {
|
|
});
|
|
|
|
expect($fileName)->toBe(__FILE__);
|
|
});
|
|
|
|
it('gets property values', function () {
|
|
$class = new class()
|
|
{
|
|
private $foo = 'bar';
|
|
};
|
|
|
|
$value = Reflection::getPropertyValue($class, 'foo');
|
|
|
|
expect($value)->toBe('bar');
|
|
});
|