2014-10-15 01:01:55 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Fenom;
|
|
|
|
|
|
|
|
|
|
|
|
class SandboxTest extends TestCase {
|
|
|
|
|
2015-02-12 12:13:35 +03:00
|
|
|
/**
|
|
|
|
* @group sb
|
|
|
|
*/
|
2014-10-15 01:01:55 +04:00
|
|
|
public function test()
|
|
|
|
{
|
2015-06-01 23:42:47 +03:00
|
|
|
return;
|
|
|
|
$this->fenom->setOptions(\Fenom::FORCE_VERIFY);
|
2015-06-02 10:59:28 +03:00
|
|
|
$this->fenom->addAccessorSmart('q', 'Navi::$q', \Fenom::ACCESSOR_VAR);
|
2014-10-15 01:01:55 +04:00
|
|
|
// $this->assertEquals([1, 2, 4, "as" => 767, "df" => ["qert"]], [1, 2, 4, "as" => 767, "df" => ["qet"]]);
|
|
|
|
// $this->fenom->addBlockCompiler('php', 'Fenom\Compiler::nope', function ($tokens, Tag $tag) {
|
|
|
|
// return '<?php ' . $tag->cutContent();
|
|
|
|
// });
|
|
|
|
// $this->tpl('welcome.tpl', '{$a}');
|
2015-02-12 12:13:35 +03:00
|
|
|
// var_dump($this->fenom->compileCode('{set $a=$one|min:0..$three|max:4}')->getBody());
|
2015-06-01 23:42:47 +03:00
|
|
|
try {
|
2015-06-02 10:59:28 +03:00
|
|
|
var_dump($this->fenom->compileCode('{set $.q.ddqd->d() = 333}')->getBody());
|
2015-06-01 23:42:47 +03:00
|
|
|
} catch (\Exception $e) {
|
|
|
|
print_r($e->getMessage() . "\n" . $e->getTraceAsString());
|
|
|
|
while ($e->getPrevious()) {
|
|
|
|
$e = $e->getPrevious();
|
|
|
|
print_r("\n\n" . $e->getMessage() . " in {$e->getFile()}:{$e->getLine()}\n" . $e->getTraceAsString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exit;
|
2014-10-15 01:01:55 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|