コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function overview($link_id = 'uc_store.admin.store')
 {
     $build['blocks'] = parent::overview($link_id);
     if ($results = $this->moduleHandler()->invokeAll('uc_store_status')) {
         $map = ['warning' => REQUIREMENT_WARNING, 'error' => REQUIREMENT_ERROR];
         foreach ($results as $message) {
             $requirements[] = ['title' => $message['title'], 'description' => $message['desc'], 'severity' => isset($map[$message['status']]) ? $map[$message['status']] : REQUIREMENT_INFO];
         }
         $build['status'] = ['#theme' => 'status_report', '#prefix' => '<h2>' . $this->t('Store status') . '</h2>', '#requirements' => $requirements];
     }
     return $build;
 }
コード例 #2
0
 /**
  * Tests setLinkActiveClass().
  *
  * @param array $element
  *  A renderable array with the following keys:
  *    - #markup
  *    - #attached
  * @param array $context
  *   The page context to simulate. An array with the following keys:
  *   - path: the system path of the currently active page
  *   - front: whether the current page is the front page (which implies the
  *     current path might also be <front>)
  *   - language: the language code of the currently active page
  *   - query: the query string for the currently active page
  * @param array $expected_element
  *   The returned renderable array.
  *
  * @dataProvider providerTestSetLinkActiveClass
  */
 public function testSetLinkActiveClass(array $element, array $context, $expected_element)
 {
     $this->assertSame($expected_element, SystemController::setLinkActiveClass($element, $context));
 }