You are here

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

Tests CRUD operation: Load.

File

tests/ctools_export_test/ctools_export.test, line 31

Class

CtoolsExportCrudTestCase
Tests for the CTools export system.

Code

public function testCrudExportLoad() {
  $loaded_export = ctools_export_crud_load('ctools_export_test', 'database_test');
  $expected_export = new stdClass();
  $expected_export->machine = 'database_test';
  $expected_export->title = 'Database test';
  $expected_export->number = 0;
  $expected_export->data = array(
    'test_1' => 'Test 1',
    'test_2' => 'Test 2',
  );
  $expected_export->table = 'ctools_export_test';
  $expected_export->export_type = EXPORT_IN_DATABASE;
  $expected_export->type = 'Normal';
  $this
    ->assertEqual($expected_export, $loaded_export, 'An exportable object has been loaded correctly from the database.');
}