You are here

public function CtoolsExportCrudTestCase::testCrudExportSave in Chaos Tool Suite (ctools) 7

Tests CRUD operation: Save.

File

tests/ctools_export_test/ctools_export.test, line 71

Class

CtoolsExportCrudTestCase
Tests for the CTools export system.

Code

public function testCrudExportSave() {
  $default_export = ctools_export_crud_load('ctools_export_test', 'default_test');
  $this
    ->assertTrue($default_export->in_code_only, 'The loaded exportable is in code only.');
  ctools_export_crud_save('ctools_export_test', $default_export);

  // Clear the static cache.
  ctools_export_load_object_reset('ctools_export_test');
  $overridden_export = ctools_export_crud_load('ctools_export_test', 'default_test');
  $this
    ->assertTrue($overridden_export->export_type === 3, 'The loaded exportable is overridden in the database.');
}