Пример #1
0
 public function testSponsor()
 {
     $sponsor = $this->getMock('BeeHub_Sponsor', array('init_props'), array('/system/sponsors/test_sponsor'));
     $sponsor->expects($this->any())->method('init_props');
     $registryMock = $this->getMock('BeeHub_Registry', array('resource'));
     $registryMock->expects($this->once())->method('resource')->will($this->returnValue($sponsor));
     \DAV::$REGISTRY = $registryMock;
     $this->assertSame($sponsor, \BeeHub::sponsor('/system/sponsors/test_sponsor'), 'BeeHub::sponsor() should return a sponsor if the path is correct');
     $registryMockNull = $this->getMock('BeeHub_Registry', array('resource'));
     $registryMockNull->expects($this->once())->method('resource')->will($this->returnValue(null));
     \DAV::$REGISTRY = $registryMockNull;
     $this->setExpectedException('DAV_Status');
     \BeeHub::group('/system/sponsors/test_sponsor', null, \DAV::HTTP_FORBIDDEN);
 }
Пример #2
0
echo DAV::determine_client() & DAV::CLIENT_IE ? 'disabled="disabled"' : '';
?>
 >
            <?php 
$registry = BeeHub_Registry::inst();
foreach ($this->user_prop_sponsor_membership() as $sponsor_path) {
    ?>
              <option value="<?php 
    echo DAV::xmlescape($sponsor_path);
    ?>
" <?php 
    echo $this->user_prop(BeeHub::PROP_SPONSOR) === $sponsor_path ? 'selected="selected"' : '';
    ?>
>
                <?php 
    echo DAV::xmlescape(BeeHub::sponsor($sponsor_path)->user_prop(DAV::PROP_DISPLAYNAME));
    ?>
              </option>
              <?php 
    $registry->forget($sponsor_path);
}
?>
          </select>
          <?php 
echo DAV::determine_client() & DAV::CLIENT_IE ? '(Sponsor can\'t be changed in Internet Explorer)' : '';
?>
        <?php 
//endif;
?>
      </div>
    </div>