aboutsummaryrefslogtreecommitdiff
path: root/rector-test.php
blob: d91925540b3dd229e8c7cbc8f876099334acaa49 (plain)
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
96
97
<?php

include 'vendor/flexi/lib/flexi.php';
require_once 'vendor/trails/trails.php';

include_once 'app/controllers/studip_controller.php';
require 'app/controllers/plugin_controller.php';
require 'app/controllers/studip_controller_properties_trait.php';
require 'app/controllers/studip_response.php';

$foo = get_config('FOO_BAR');;
$foo = studip_json_encode($foo);
$foo = studip_json_decode($foo, true);
echo transformBeforeSave(smile($foo));

Sidebar::setImage('foo.gif');
$bar = Sidebar::getImage();
Sidebar::removeImage();

/** @var StudipCache $cache */
$cache = StudipCacheFactory::getCache();
if ($cache instanceof StudipDbCache) {
    echo 'Cached in database';
}

$factory = new Flexi_TemplateFactory(__DIR__);
/** @var Flexi_Template $template */
$template = $factory->open('foo.php');
if ($template instanceof Flexi_PhpTemplate) {
    echo 'Template is php';
}

try {
    $dispatcher = new Trails_Dispatcher('', '', '');
    $controller = new Trails_Controller($dispatcher);
    $flash = new Trails_Flash();
    $inflector = new Trails_Inflector();
} catch (Trails_DoubleRenderError $e) {
    echo 'double render';
} catch (Trails_MissingFile $e) {
    echo 'missing file';
} catch (Trails_RoutingError $e) {
    echo 'routing error';
} catch (Trails_SessionRequiredException $e) {
    echo 'session required';
} catch (Trails_UnknownAction $e) {
    echo 'unknown action';
} catch (Trails_UnknownController $e) {
    echo 'unknown controller';
} catch (Trails_Exception $e) {
    echo 'some exception';
}

class TestBlockType extends \Courseware\BlockTypes\BlockType
{
    public static function getType(): string
    {
        return '';
    }

    public static function getTitle(): string
    {
        return '';
    }

    public static function getDescription(): string
    {
        return '';
    }

    public function initialPayload(): array
    {
        return [];
    }

    public static function getCategories(): array
    {
        return [];
    }

    public static function getContentTypes(): array
    {
        return [];
    }

    public static function getFileTypes(): array
    {
        return [];
    }

    public static function getJsonSchema(): \Opis\JsonSchema\Schema
    {
        return \Opis\JsonSchema\Schema::fromJsonString(file_get_contents(__FILE__));
    }
}

page_close();