Here are the remaining CRUD tests.

Comments

dawehner’s picture

+++ b/tests/ctools_export_test/ctools_exportable.testundefined
@@ -39,6 +39,36 @@ class CToolsExportableTestCase extends WebTestBase {
+    $created_export = $controller->create();

Just in general, is there a procedural wrapper around creating an exportable?

+++ b/tests/ctools_export_test/ctools_exportable.testundefined
@@ -94,6 +124,33 @@ class CToolsExportableTestCase extends WebTestBase {
+    // TODO: Replace with reloading the exportable when we can clear the caches in controller.
+    $result = db_query("SELECT title from {ctools_export_test} WHERE machine = 'default_test'")->fetchField();
+
+    $this->assertFalse($result, 'An overridden exportable has been deleted from the database and reverted to it\'s default.');

couldn't we load the exportable and check isInDatabase? Maybe that's exactly what you wrote in the todo.

damiankloip’s picture

There isn't any wrapper function yet for these CRUD functions, I am going to work on a patch for these today.

Yes, the todo is pretty much what you described. Currently if you check after deleting an exportable, the static cache will still have the old statuses on the object. When the caching has been added into the code, we can change this. For now, I think we need this way to have a working test. What do you think?

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

This makes sense, thanks for clarify this.

damiankloip’s picture

Status: Reviewed & tested by the community » Fixed

Thanks dawehner, committed to 8.x branch: http://drupalcode.org/project/ctools.git/commit/f0fbb1d

Automatically closed -- issue fixed for 2 weeks with no activity.