MCPcopy Create free account
hub / github.com/cutelyst/cutelyst / getEngine

Method getEngine

tests/testviewjson.cpp:108–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108TestEngine *TestActionRenderView::getEngine()
109{
110 auto app = new TestApplication;
111 auto engine = new TestEngine(app, QVariantMap());
112 new TestViewJSON(app);
113
114 new ViewJson(app);
115 auto v1 = new ViewJson(app, u"view1"_s);
116 v1->setExposeStash(u"SingleKey"_s);
117 v1->setXJsonHeader(true);
118
119 auto v2 = new ViewJson(app, u"view2"_s);
120 v2->setExposeStash({u"One"_s, u"Two"_s});
121 v2->setXJsonHeader(true);
122
123 auto v3 = new ViewJson(app, u"view3"_s);
124 v3->setExposeStash(QRegularExpression(u"\\d"_s));
125
126 auto v4 = new ViewJson(app, u"view4"_s);
127 v4->setOutputFormat(ViewJson::Indented);
128
129 if (!engine->init()) {
130 return nullptr;
131 }
132 return engine;
133}
134
135void TestActionRenderView::cleanupTestCase()
136{

Callers

nothing calls this directly

Calls 4

setExposeStashMethod · 0.80
setXJsonHeaderMethod · 0.80
setOutputFormatMethod · 0.80
initMethod · 0.45

Tested by

no test coverage detected