public function KalturaMetadataTestCase::testCreatePartner in Kaltura 7.2
Same name and namespace in other branches
- 7.3 tests/kaltura_metadat.test \KalturaMetadataTestCase::testCreatePartner()
File
- tests/
kaltura_metadat.test, line 23
Class
- KalturaMetadataTestCase
- Ensure that adding partner info works properly.
Code
public function testCreatePartner() {
$this
->drupalGet('admin/config/kaltura/general');
$edit['first_name'] = 'name';
$edit['last_name'] = 'last';
$edit['email'] = $this
->randomname(1) . '@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';
$kaltura_client = KalturaHelpers::getKalturaClient(TRUE);
$session_user = KalturaHelpers::getSessionUser();
$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);
}