File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -345,4 +345,26 @@ public function testGenericInstances() {
345
345
$ this ->assertEquals ($ expected , TableRegistry::genericInstances ());
346
346
}
347
347
348
+ /**
349
+ * Tests deleting an instance
350
+ *
351
+ * @return void
352
+ */
353
+ public function testDelete () {
354
+ Plugin::load ('TestPlugin ' );
355
+
356
+ $ pluginTable = TableRegistry::get ('TestPlugin.Comments ' );
357
+ $ cachedTable = TableRegistry::get ('Comments ' );
358
+
359
+ $ this ->assertTrue (TableRegistry::exists ('Comments ' ));
360
+ $ this ->assertSame ($ pluginTable , $ cachedTable );
361
+
362
+ TableRegistry::delete ('Comments ' );
363
+ $ this ->assertFalse (TableRegistry::exists ('Comments ' ));
364
+
365
+ $ appTable = TableRegistry::get ('Comments ' );
366
+ $ this ->assertTrue (TableRegistry::exists ('Comments ' ));
367
+ $ this ->assertNotSame ($ pluginTable , $ appTable );
368
+ }
369
+
348
370
}
You can’t perform that action at this time.
0 commit comments