-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.php
96 lines (64 loc) · 2.33 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
ini_set('display_errors', 1);
$container = require_once __DIR__ . '/app/bootstrap.php';
$runner = $container->get('application');
use PhpWorkshop\PhpWorkshop\Exercise\BabySteps;
use PhpWorkshop\PhpWorkshop\Exercise\HelloWorld;
use PhpWorkshop\PhpWorkshop\Exercise\MyFirstIo;
use PhpWorkshop\PhpWorkshop\Exercise\FilteredLs;
echo "====HELLO WORLD====\n\n";
$helloWorld = new HelloWorld;
echo "____FAIL___\n\n";
$result = $runner->runExercise($helloWorld, __DIR__ . '/test/res/hello-world-fail.php');
echo "Successful?\n";
var_dump($result->isSuccessful());
echo "Errors\n";
var_dump($result->getErrors());
echo "____PASS___\n\n";
$result = $runner->runExercise($helloWorld, __DIR__ . '/test/res/hello-world-pass.php');
echo "Successful?\n";
var_dump($result->isSuccessful());
echo "Errors\n";
var_dump($result->getErrors());
echo "====BABY STEPS====\n\n";
$babySteps = new BabySteps;
echo "____FAIL___\n\n";
$result = $runner->runExercise($babySteps, __DIR__ . '/test/res/baby-steps-fail.php');
echo "Successful?\n";
var_dump($result->isSuccessful());
echo "Errors\n";
var_dump($result->getErrors());
echo "____PASS___\n\n";
$result = $runner->runExercise($babySteps, __DIR__ . '/test/res/baby-steps-pass.php');
echo "Successful?\n";
var_dump($result->isSuccessful());
echo "Errors\n";
var_dump($result->getErrors());
echo "====My First IO====\n\n";
$myFirstIo = $container->get(MyFirstIo::class);
echo "____FAIL___\n\n";
$result = $runner->runExercise($myFirstIo, __DIR__ . '/test/res/my-first-io-fail.php');
echo "Successful?\n";
var_dump($result->isSuccessful());
echo "Errors\n";
var_dump($result->getErrors());
echo "____PASS___\n\n";
$result = $runner->runExercise($myFirstIo, __DIR__ . '/test/res/my-first-io-pass.php');
echo "Successful?\n";
var_dump($result->isSuccessful());
echo "Errors\n";
var_dump($result->getErrors());
echo "====Filtered LS====\n\n";
$filteredLs = $container->get(FilteredLs::class);
echo "____FAIL___\n\n";
$result = $runner->runExercise($filteredLs, __DIR__ . '/test/res/filtered-ls-fail.php');
echo "Successful?\n";
var_dump($result->isSuccessful());
echo "Errors\n";
var_dump($result->getErrors());
echo "____PASS___\n\n";
$result = $runner->runExercise($filteredLs, __DIR__ . '/test/res/filtered-ls-pass.php');
echo "Successful?\n";
var_dump($result->isSuccessful());
echo "Errors\n";
var_dump($result->getErrors());