You are here

GlobalClassUnitTest.inc in Coder 8.3.x

Same filename and directory in other branches
  1. 8.3 tests/DrupalPractice/Objects/GlobalClassUnitTest.inc

File

tests/DrupalPractice/Objects/GlobalClassUnitTest.inc
View source
<?php

use Drupal\node\Entity\NodeType;
use Drupal\node\NotEntity\User;
class TestForm extends FormBase {
  public function buildForm($form, $form_state) {
    $form['something'] = NodeType::load('article');
  }
  public static function something() {

    // Global classes are allowed in static methods.
    return NodeType::load('article');
  }
  public function notentity() {

    // This is not a user entity.
    return User::load(1);
  }

}

Classes

Namesort descending Description
TestForm