testing_example_test.module

Same filename and directory in other branches
  1. 4.0.x modules/testing_example/tests/modules/testing_example_test/testing_example_test.module

Implements testing_example_test module.

File

modules/testing_example/tests/modules/testing_example_test/testing_example_test.module

View source
<?php


/**
 * @file
 * Implements testing_example_test module.
 */
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Entity\EntityInterface;

/**
 * The mock module for SimpleTest Example.
 *
 * This module exists so that we can enable it and use it to
 * test elements of testing_example.
 *
 * @ingroup testing_example
 */

/**
 * Implements hook_ENTITY_TYPE_view().
 *
 * We'll just add some content to nodes of the type we like.
 *
 * @ingroup testing_example
 */
function testing_example_test_node_view(array &$build, EntityInterface $node, EntityViewDisplayInterface $display, $view_mode) {
    if ($node->getType() == 'testing_example') {
        $build['simpletest_example_test_section'] = [
            '#markup' => t('The test module did its thing.'),
            '#weight' => -99,
        ];
    }
}

Functions

Title Deprecated Summary
testing_example_test_node_view Implements hook_ENTITY_TYPE_view().