php - Is it possible to get the rendered view output from a Phalcon controller? From within a unit test?

one text

Solution:

in short you can use Phalcon\Mvc\View\Simple to render views without hierarchical levels

use Phalcon\Mvc\View\Simple;

$view = new Simple();

$view->setViewsDir('../app/views/');

echo $view->render('templates/welcome');

echo $view->render(
    'templates/welcome',
    [
        'email'   => $email,
        'content' => $content,
    ]
);

or you can check the documentation for other/complex options

Source