Including security review as a submodule - with patched for Yaffs.
[yaffs-website] / web / modules / contrib / security_review / tests / modules / security_review_test / src / Test.php
1 <?php
2
3 /**
4  * @file
5  * Contains \Drupal\security_review_test\Test.
6  */
7
8 namespace Drupal\security_review_test;
9
10 use Drupal\security_review\Check;
11 use Drupal\security_review\CheckResult;
12
13 /**
14  * A test security check for testing extensibility.
15  */
16 class Test extends Check {
17
18   /**
19    * {@inheritdoc}
20    */
21   public function getNamespace() {
22     return 'Security Review Test';
23   }
24
25   /**
26    * {@inheritdoc}
27    */
28   public function getTitle() {
29     return 'Test';
30   }
31
32   /**
33    * {@inheritdoc}
34    */
35   public function run() {
36     $findings = [];
37     for ($i = 0; $i < 20; ++$i) {
38       $findings[] = rand(0, 1) ? rand(0, 10) : 'string';
39     }
40
41     return $this->createResult(CheckResult::INFO, $findings);
42   }
43
44   /**
45    * {@inheritdoc}
46    */
47   public function help() {
48     return [];
49   }
50
51   /**
52    * {@inheritdoc}
53    */
54   public function getMessage($result_const) {
55     return 'The test ran.';
56   }
57
58 }