kaltura_metadat.test in Kaltura 7.3
Same filename and directory in other branches
Tests functionality for handling metadata.
File
tests/kaltura_metadat.testView source
<?php
/**
* @file
* Tests functionality for handling metadata.
*/
/**
* Ensure that adding partner info works properly.
*/
class KalturaMetadataTestCase extends DrupalWebTestCase {
public static function getInfo() {
return array(
'name' => 'Change metadata',
'description' => 'Change entry metadata',
'group' => 'Kaltura',
);
}
function setUp() {
parent::setUp('kaltura');
$admin_user = $this
->drupalCreateUser(array(
'administer site configuration',
'administer kaltura',
));
$this
->drupalLogin($admin_user);
}
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);
}
}
Classes
Name | Description |
---|---|
KalturaMetadataTestCase | Ensure that adding partner info works properly. |