示例#1
0
 public function testRateUpdate()
 {
     $profile = new VoxbProfile();
     $profile->setUserId($this->users[0]);
     $record_data = $profile->getVoxbUserData('111111111');
     $item = new VoxbItem();
     $item->fetchByFaust('111111111');
     $r = $item->rateItem('111111111', 90, $this->users[0]);
     $this->assertFalse($r);
     $item->updateRateItem($record_data['voxbIdentifier'], 100);
     $ratingAfter = $item->getRating();
     $this->assertEquals($ratingAfter, 55);
 }
示例#2
0
 public function testUpdateTag()
 {
     $obj = VoxbBase::getInstance();
     $profile = new VoxbProfile();
     $profile->setUserId($this->users[0]);
     $profile->fetchMyData();
     // add a new tag (and keep old tags)
     $tag = new VoxbTagRecord();
     $this->assertTrue($tag->create('111111111', 'tag_new', $profile));
     $item = new VoxbItem();
     $item->fetchByFaust('111111111');
     $this->assertEquals($item->getTags()->getCount(), 5);
 }
示例#3
0
 public function testUpdateReview()
 {
     $profile = new VoxbProfile();
     $profile->setUserId($this->users[0]);
     $profile->fetchMyData();
     $item = new VoxbItem();
     $item->addReviewHandler('review', new VoxbReviews());
     $item->fetchByFaust('111111111');
     $reviews = $item->getReviews('review');
     $reviewsNumBefore = $reviews->getCount();
     // Attempt to update a review
     $review = new VoxbReviewRecord();
     $r = $review->create('111111111', 'SecondReview', $profile);
     $this->assertTrue($r);
     $item = new VoxbItem();
     $item->addReviewHandler('review', new VoxbReviews());
     $item->fetchByFaust('111111111');
     $reviews = $item->getReviews('review');
     $reviewsNumAfter = $reviews->getCount();
     $reviews = $reviews->toArray();
     $this->assertEquals($reviewsNumBefore, $reviewsNumAfter);
     $this->assertEquals($reviews[0]['text'], 'SecondReview');
 }
示例#4
0
 public function testReviewsList()
 {
     $obj = new VoxbItem();
     $obj->addReviewHandler('review', new VoxbReviews());
     $obj->fetchByFaust('111111111');
     $this->assertNotNull($obj->getReviews('review'));
     $reviews = $obj->getReviews('review')->toArray();
     $this->assertEquals($obj->getReviews('review')->getCount(), 3);
     $this->assertTrue(is_array($reviews));
 }
示例#5
0
 * Available variables:
 * - $object: The TingClientObject instance we're rendering.
 */
if (module_exists('ding_voxb')) {
    drupal_add_css(DING_VOXB_PATH . '/css/voxb-pager.css');
    drupal_add_css(DING_VOXB_PATH . '/css/voxb.css');
    drupal_add_css(DING_VOXB_PATH . '/css/jqModal.css');
    drupal_add_js(DING_VOXB_PATH . '/js/jqModal.js');
    drupal_add_js(DING_VOXB_PATH . '/js/livequery.js');
    drupal_add_js(DING_VOXB_PATH . '/js/cyclic.fade.js');
    drupal_add_js(DING_VOXB_PATH . '/js/voxb.item.js');
    require_once DING_VOXB_PATH . '/lib/VoxbItem.class.php';
    require_once DING_VOXB_PATH . '/lib/VoxbProfile.class.php';
    require_once DING_VOXB_PATH . '/lib/VoxbReviews.class.php';
    $faust_number = $object->localId;
    $voxb_item = new VoxbItem();
    $voxb_item->addReviewHandler('review', new VoxbReviews());
    $voxb_item->fetchByFaust($faust_number);
    $profile = unserialize($_SESSION['voxb']['profile']);
}
?>

<!-- ting_object.tpl -->
<div id="ting-object" class="line rulerafter">

  <div class="picture unit grid-3 alpha">
    <?php 
if (strpos($cover, 'imagecache')) {
    ?>
      <div class="inner left" style="margin-bottom:10px;">
        <?php