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()
41
41
$ config = Cache::getConfig ($ name );
42
42
if (isset ($ config ['className ' ]) && $ config ['className ' ] instanceof DebugEngine) {
43
43
$ instance = $ config ['className ' ];
44
- } else {
44
+ } elseif ( isset ( $ config [ ' className ' ])) {
45
45
Cache::drop ($ name );
46
46
$ instance = new DebugEngine ($ config );
47
47
Cache::setConfig ($ name , $ instance );
48
48
}
49
- $ this ->_instances [$ name ] = $ instance ;
49
+ if (isset ($ instance )) {
50
+ $ this ->_instances [$ name ] = $ instance ;
51
+ }
50
52
}
51
53
}
52
54
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ public function tearDown()
48
48
{
49
49
parent ::tearDown ();
50
50
Cache::drop ('debug_kit_test ' );
51
+ Cache::drop ('incomplete ' );
51
52
}
52
53
53
54
/**
@@ -64,6 +65,21 @@ public function testInitialize()
64
65
$ this ->assertArrayHasKey ('_cake_model_ ' , $ result ['metrics ' ]);
65
66
}
66
67
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
+
67
83
/**
68
84
* test initialize incomplete data
69
85
*
You can’t perform that action at this time.
0 commit comments