testing_example_test.module

Same filename in other branches
  1. 8.x-1.x testing_example/tests/modules/testing_example_test/testing_example_test.module
  2. 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().