function test___call()
 {
     $manager = Manager::getInstance();
     $service = 'Avatars';
     $instance = new $this->myClass($manager, $service);
     $this->assertInstanceOf($this->myClass, $instance);
     $x = $instance->dummy();
     $this->assertInstanceOf('\\Xoops\\Core\\Service\\Response', $x);
 }
Beispiel #2
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $manager = Manager::getInstance();
     $this->object = new Provider($manager, $this->service);
 }
Beispiel #3
0
 /**
  * get the service manager
  *
  * @param string $service - service name
  *
  * @return Xoops\Core\Service\Provider instance
  */
 public function service($service)
 {
     static $instance;
     if (!isset($instance)) {
         $instance = \Xoops\Core\Service\Manager::getInstance();
     }
     return $instance->locate($service);
 }
Beispiel #4
0
$xoops->theme()->addStylesheet('modules/system/css/admin.css');
$xoops->theme()->addBaseScriptAssets('@jqueryui', '@jgrowl', 'modules/system/js/admin.js');
$xoops->header('admin:system/system_services.tpl');
$admin_page = new \Xoops\Module\Admin();
$admin_page->addBreadcrumbLink(SystemLocale::CONTROL_PANEL, \XoopsBaseConfig::get('url') . '/admin.php', true);
$admin_page->addBreadcrumbLink(SystemLocale::SERVICES_MANAGER, $system->adminVersion('services', 'adminpath'));
$admin_page->addBreadcrumbLink(XoopsLocale::MAIN);
$admin_page->addTips(SystemLocale::SERVICES_TIPS);
$admin_page->renderBreadcrumb();
$admin_page->renderTips();
$selected_service = '';
if (isset($_GET['service'])) {
    $selected_service = strtolower(XoopsFilterInput::clean($_GET['service'], 'WORD'));
}
$xoops->tpl()->assign('selected_service', $selected_service);
$sm = Manager::getInstance();
$filter = 'coreservicelocate';
$eventList = $xoops->events()->getEvents();
$l = strlen($filter);
$filteredList = array();
foreach ($eventList as $k => $v) {
    if (strncasecmp($filter, $k, $l) == 0) {
        $filteredList[] = strtolower(substr($k, $l));
    }
}
$service_list = array();
sort($filteredList);
foreach ($filteredList as $v) {
    $service_list[] = array('name' => $v, 'display' => ucfirst($v), 'active' => $v == $selected_service);
}
$xoops->tpl()->assign('service_list', $service_list);