File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -41,12 +41,14 @@ public function initialize()
4141 $ config = Cache::getConfig ($ name );
4242 if (isset ($ config ['className ' ]) && $ config ['className ' ] instanceof DebugEngine) {
4343 $ instance = $ config ['className ' ];
44- } else {
44+ } elseif ( isset ( $ config [ ' className ' ])) {
4545 Cache::drop ($ name );
4646 $ instance = new DebugEngine ($ config );
4747 Cache::setConfig ($ name , $ instance );
4848 }
49- $ this ->_instances [$ name ] = $ instance ;
49+ if (isset ($ instance )) {
50+ $ this ->_instances [$ name ] = $ instance ;
51+ }
5052 }
5153 }
5254
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ public function tearDown()
4848 {
4949 parent ::tearDown ();
5050 Cache::drop ('debug_kit_test ' );
51+ Cache::drop ('incomplete ' );
5152 }
5253
5354 /**
@@ -64,6 +65,21 @@ public function testInitialize()
6465 $ this ->assertArrayHasKey ('_cake_model_ ' , $ result ['metrics ' ]);
6566 }
6667
68+ /**
69+ * test initialize incomplete data
70+ *
71+ * @return void
72+ */
73+ public function testInitializeNoProxyIncompleteConfig ()
74+ {
75+ $ data = ['duration ' => '+2 seconds ' ];
76+ Cache::setConfig ('incomplete ' , $ data );
77+ $ this ->panel ->initialize ();
78+
79+ $ config = Cache::getConfig ('incomplete ' );
80+ $ this ->assertSame ($ data , $ config );
81+ }
82+
6783 /**
6884 * test initialize incomplete data
6985 *
You can’t perform that action at this time.
0 commit comments