You are here

public function KalturaMetadataTestCase::testCreatePartner in Kaltura 7.3

Same name and namespace in other branches
  1. 7.2 tests/kaltura_metadat.test \KalturaMetadataTestCase::testCreatePartner()

File

tests/kaltura_metadat.test, line 27
Tests functionality for handling metadata.

Class

KalturaMetadataTestCase
Ensure that adding partner info works properly.

Code

public function testCreatePartner() {
  $this
    ->drupalGet('admin/config/media/kaltura/general');
  $edit['first_name'] = 'name';
  $edit['last_name'] = 'last';
  $edit['email'] = $this
    ->randomname(16) . '@example.com';
  $edit['phone'] = '111111111';
  $edit['company'] = 'autotest';
  $edit['title'] = 'autotestbot';
  $edit['vertical'] = 'Media';
  $edit['country'] = 'IL';
  $edit['would_you_like_to_be_contacted'] = 'no';
  $edit['terms'] = TRUE;
  $this
    ->drupalPost(NULL, $edit, t('submit'));
  $this
    ->assertText(t('Congratulations!'), t('Make sure instaltion is complate'));
  $path = drupal_get_path('module', 'kaltura') . '/tests/test.flv';
  $helpers = new KalturaHelpers();
  $kaltura_client = $helpers
    ->getKalturaClient(TRUE);
  $token = $kaltura_client->baseEntry
    ->upload($path);
  $entry = new KalturaBaseEntry();
  $entry->name = $name;
  $res = $kaltura_client->baseEntry
    ->addFromUploadedFile($entry, $token, NULL);
  $eid = $res['id'];
  $rows = db_select('node_kaltura', 'n')
    ->fields('kaltura_entryid')
    ->condition('kaltura_entryid', $eid, '=')
    ->countQuery()
    ->execute()
    ->fetchField();
  if ($rows == 1) {

    // Add asertion text for ok.
  }
  else {

    // Add asertion text for bad.
  }

  // debug($eid);
}