HEX
Server: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: iestorre (46869)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/iestorre/www2/modules/views/tests/handlers/views_handler_area_text.test
<?php
module_load_include('test', 'views', 'tests/views_query');

class ViewsHandlerAreaTextTest extends ViewsSqlTest {
  public static function getInfo() {
    return array(
      'name' => 'Area: Text',
      'description' => 'Test the core views_handler_area_text handler.',
      'group' => 'Views Handlers',
    );
  }

  public function testAreaText() {
    $view = $this->getBasicView();

    // add a text header
    $string = $this->randomString();
    $view->display['default']->handler->override_option('header', array(
      'area' => array(
        'id' => 'area',
        'table' => 'views',
        'field' => 'area',
        'content' => $string,
      ),
    ));

    // Execute the view.
    $this->executeView($view);

    $view->display_handler->handlers['header']['area']->options['format'] = FILTER_FORMAT_DEFAULT;
    $this->assertEqual(check_markup($string), $view->display_handler->handlers['header']['area']->render(), 'Existant format should return something');

    // Empty results, and it shouldn't be displayed .
    $this->assertEqual('', $view->display_handler->handlers['header']['area']->render(TRUE), 'No result should lead to no header');
    // Empty results, and it should be displayed.
    $view->display_handler->handlers['header']['area']->options['empty'] = TRUE;
    $this->assertEqual(check_markup($string), $view->display_handler->handlers['header']['area']->render(TRUE), 'No result, but empty enabled lead to a full header');
  }

}