public function testNodeVisitorAddSliceFilterAndPaginationNode()
{
$env = $this->createEnv();
$stream = $env->parse($env->tokenize('{{ paginate(collection, 6) }}'));
// Transformed in "{{ collection|slice(__offset_0__, 6) }}"
// collection|slice(__offset_0__, 6)
$nodeFilter = $stream->getNode('body')->getNode(0)->getNode('expr');
$this->assertInstanceOf('Twig_Node_Expression_Filter', $nodeFilter);
$this->assertNodeFilterHasSlice($nodeFilter, 6);
$blocksNode = $stream->getNode('blocks');
$this->assertInstanceOf('Twig_Node', $blocksNode);
$paginationNode = $blocksNode->getNode('pagination');
$this->assertInstanceOf('Carew\\Twig\\Node\\Pagination', $paginationNode);
$this->assertInstanceOf('Twig_Node_Expression_Name', $paginationNode->getNode(0));
$this->assertSame('collection', $paginationNode->getNode(0)->getAttribute('name'));
$this->assertSame(array(6), $paginationNode->getAttribute('maxesPerPage'));
}