PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.4.8
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.4.8
4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 3.10.4 All 148 releases
visualizer / vendor / neitanod / forceutf8 / test / Test.class.php

Test.class.php in Visualizer – Tables & Charts Manager with Built-in AI Generator 3.4.8, at vendor/neitanod/forceutf8/test/Test.class.php

63 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 class Test {
3 protected static $passed = 0;
4 protected static $failed = 0;
5 protected static $last_echoed;
6
7 public static function true($test_name, $result){
8 return static::is($test_name, $result, true);
9 }
10
11 public static function is($test_name, $result, $expected){
12 if($result == $expected) {
13 static::passed($test_name);
14 } else {
15 static::failed($test_name);
16 }
17 }
18
19 public static function not($test_name, $result, $expected){
20 if($result == $expected) {
21 static::failed($test_name);
22 } else {
23 static::passed($test_name);
24 }
25 }
26
27 public static function identical($test_name, $result, $expected){
28 if($result === $expected) {
29 static::passed($test_name);
30 } else {
31 static::failed($test_name);
32 }
33 }
34
35 public static function totals(){
36 echo "\n";
37 echo static::$passed." tests passed.\n";
38 echo static::$failed." tests failed.\n";
39 }
40
41 private static function failed($test_name){
42 echo "\n".$test_name." -> FAILED\n";
43 static::$failed++;
44 }
45
46 private static function passed($test_name){
47 static::character(".");
48 static::$passed++;
49 }
50
51 private static function character($char){
52 echo $char;
53 static::$last_echoed = 'char';
54 }
55
56 private static function line($msg){
57 if(static::$last_echoed == 'char') echo "\n";
58 echo $msg."\n";
59 static::$last_echoed = 'line';
60 }
61 }
62
63