From f34424994c98afb420b0b84d7d731ee627516eeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sun, 7 Jun 2020 13:41:49 +0200 Subject: [PATCH] Fix missing DIContainerTrait when StaticAddToTrait is used --- demos/_unit-test/console_run.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/demos/_unit-test/console_run.php b/demos/_unit-test/console_run.php index 26fd6eeb49..c370d237db 100644 --- a/demos/_unit-test/console_run.php +++ b/demos/_unit-test/console_run.php @@ -6,9 +6,8 @@ require_once __DIR__ . '/../atk-init.php'; -$testRun = get_class(new class() extends \atk4\data\Model { +$testRun = new class() extends \atk4\data\Model { use \atk4\core\DebugTrait; - use \atk4\core\StaticAddToTrait; public function test() { @@ -24,10 +23,10 @@ public function test() return 123; } -}); +}; $sse = jsSSE::addTo($app); $sse->urlTrigger = 'console_test'; $console = \atk4\ui\Console::addTo($app, ['sse' => $sse]); -$console->runMethod($testRun::addTo($app), 'test'); +$console->runMethod($app->add($testRun), 'test');