You are here

function test5 in Coder 8.2

Same name in this branch
  1. 8.2 coder_sniffer/Drupal/Test/Commenting/FunctionCommentUnitTest.inc \test5()
  2. 8.2 coder_sniffer/Drupal/Test/bad/bad.php \test5()
  3. 8.2 coder_sniffer/Drupal/Test/good/good.php \test5()
Same name and namespace in other branches
  1. 8.3 tests/DrupalPractice/CodeAnalysis/VariableAnalysisUnitTest.inc \test5()
  2. 8.3 tests/Drupal/Commenting/FunctionCommentUnitTest.inc \test5()
  3. 8.3 tests/Drupal/bad/bad.php \test5()
  4. 7.2 coder_sniffer/Test/bad/bad.php \test5()
  5. 8.3.x tests/DrupalPractice/CodeAnalysis/VariableAnalysisUnitTest.inc \test5()
  6. 8.3.x tests/Drupal/Commenting/FunctionCommentUnitTest.inc \test5()
  7. 8.3.x tests/Drupal/bad/bad.php \test5()

Test chained method indentation which should not throw errors.

File

coder_sniffer/Drupal/Test/good/good.php, line 1135
This file contains all the valid notations for the drupal coding standard.

Code

function test5() {
  $mock
    ->expects($this
    ->any())
    ->method('findTranslation')
    ->will($this
    ->returnCallback(function ($argument) use ($translations) {
    if (isset($translations[$argument['language']][$argument['source']])) {
      return (object) array(
        'translation' => $translations[$argument['language']][$argument['source']],
      );
    }
    return TRUE;
  }));
}