You are here

ExceptionTUnitTest.inc in Coder 8.3.x

Same filename and directory in other branches
  1. 8.3 tests/DrupalPractice/General/ExceptionTUnitTest.inc

File

tests/DrupalPractice/General/ExceptionTUnitTest.inc
View source
<?php

class ExceptionExample {
  public function foo() {
    throw new Exception(t('Error'));
  }
  public function bar() {
    throw new Exception($this
      ->t('Error'));
  }
  public function lorem() {
    return t('Error');
  }
  public function ipsum() {
    return $this
      ->t('Error');
  }
  public function dolor() {
    throw (new PipelineStepExecutionLogicException('Graph data could not be inserted'))
      ->setUserMessage([
      '#markup' => $this
        ->t('Could not store triples in triple store. Reason: @message', [
        '@message' => t('Failed'),
      ]),
    ]);
  }

}

Classes

Namesort descending Description
ExceptionExample