You are here

public function PMPAPIWebTestCase::testPmpAPIDoQuery in Public Media Platform API Integration 7

Makes a basic query to the PMP.

File

tests/pmpapi.test, line 76

Class

PMPAPIWebTestCase
Tests the functionality of the PMPAPI module.

Code

public function testPmpAPIDoQuery() {
  module_load_include('php', 'pmpapi', 'tests/settings');
  $vars = pmpapi_test_get_secret_vars();
  $params = array(
    'tag' => $vars['sample_tag'],
  );
  $doc = pmpapi_query($params);
  $is_non_empty_object = is_object($doc) && !empty($doc) && empty($doc->errors['query']);
  $this
    ->assertTrue($is_non_empty_object, 'successfully pulled, without errors, query that is not empty.');
}