/** * Test the parsing of the valid "if" block in the string */ public function testValidParsingRawBlock() { $t = new Tokenizer(); $document = 'this is a {% raw %} inside {% endraw %} here'; $tokens = $t->execute($document); // The result should be an array with a nested array for the "if" start/end $this->assertTrue(is_array($tokens) && isset($tokens[0][0])); $this->assertCount(2, $tokens[0]); // Check the types of the start/end tokens $this->assertEquals('block', $tokens[0][0]->getType()); $this->assertEquals('block', $tokens[0][1]->getType()); // Check the token values for the start/end tokens $this->assertEquals('raw', $tokens[0][0]->getToken()); $this->assertEquals('endraw', $tokens[0][1]->getToken()); }