mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
More test, reformat code to PSR-0
This commit is contained in:
@@ -1,11 +1,20 @@
|
||||
<?php
|
||||
namespace Fenom;
|
||||
|
||||
use Fenom\Error\UnexpectedTokenException;
|
||||
use Fenom\Tokenizer;
|
||||
|
||||
class TokenizerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function testGetName()
|
||||
{
|
||||
$this->assertSame('T_DOUBLE_COLON', Tokenizer::getName(T_DOUBLE_COLON));
|
||||
$this->assertSame('++', Tokenizer::getName('++'));
|
||||
$this->assertSame('T_STRING', Tokenizer::getName(array(308, 'all', "", 1, "T_STRING")));
|
||||
$this->assertNull(Tokenizer::getName(false));
|
||||
}
|
||||
|
||||
public function testTokens()
|
||||
{
|
||||
$code = 'hello, please resolve this example: sin($x)+tan($x*$t) = {U|[0,1]}';
|
||||
@@ -66,6 +75,7 @@ class TokenizerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame($code, $tokens->getSnippetAsString(-100, 100));
|
||||
$this->assertSame('+', $tokens->getSnippetAsString(100, -100));
|
||||
$this->assertSame('sin($x)+tan($x*$t)', $tokens->getSnippetAsString(-4, 6));
|
||||
$this->assertSame('}', $tokens->end()->current());
|
||||
}
|
||||
|
||||
public function testSkip()
|
||||
|
||||
Reference in New Issue
Block a user