1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-12 00:54:11 +02:00

Event: detecting source without filesystem check (#428)

Co-authored-by: Marek Stipek <stipek@shoptet.cz>
This commit is contained in:
Marek Štípek
2022-11-18 04:32:56 +01:00
committed by David Grudl
parent 3a962de553
commit 7fa05f381b
2 changed files with 26 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
<?php
declare(strict_types=1);
use Tester\Assert;
require __DIR__ . '/bootstrap.php';
$conn = new Dibi\Connection($config);
$event = new Dibi\Event($conn, Dibi\Event::CONNECT);
Assert::same([__FILE__, __LINE__ - 1], $event->source);
eval('$event = new Dibi\Event($conn, Dibi\Event::CONNECT);');
Assert::same([__FILE__, __LINE__ - 1], $event->source);
array_map(function () use ($conn) {
$event = new Dibi\Event($conn, Dibi\Event::CONNECT);
Assert::same([__FILE__, __LINE__ - 1], $event->source);
}, [null]);