pluginsEnabled[] = 'wrap';
parent::setUp();
}
public function test_nestedheading() {
$instructions = p_get_instructions("\n==== Heading ====\n\nSome text\n");
$expected =
array(
array(
'document_start',
array(),
0
),
array(
'plugin',
array(
'wrap_divwrap',
array(
DOKU_LEXER_ENTER,
''
),
1
),
array(
'header',
array(
'Heading',
3,
8
),
8
),
array(
'plugin',
array(
'wrap_closesection',
array(),
DOKU_LEXER_SPECIAL,
false
),
8
),
array(
'p_open',
array(),
8
),
array(
'cdata',
array(
'Some text'
),
27
),
array(
'p_close',
array(),
37
),
array(
'plugin',
array(
'wrap_divwrap',
array(
DOKU_LEXER_EXIT,
''
),
DOKU_LEXER_EXIT,
''
),
37
),
array(
'document_end',
array(),
37
)
);
$this->assertEquals($expected, $instructions);
}
public function test_blocknesting() {
$instructions = p_get_instructions("\nFoo\n\n Bar\n");
$expected =
array(
array(
'document_start',
array(),
0
),
array(
'plugin',
array(
'wrap_divwrap',
array(
DOKU_LEXER_ENTER,
''
),
1
),
array(
'p_open',
array(
),
1
),
array(
'cdata',
array(
'Foo'
),
8
),
array(
'p_close',
array(),
11
),
array(
'p_open',
array(
),
11
),
array(
'cdata',
array(
' Bar'
),
13
),
array(
'p_close',
array(),
33
),
array(
'plugin',
array(
'wrap_divwrap',
array(
DOKU_LEXER_EXIT,
''
),
DOKU_LEXER_EXIT,
''
),
33
),
array(
'document_end',
array(),
33
)
);
$this->assertEquals($expected, $instructions);
}
public function test_inlinenesting() {
$instructions = p_get_instructions("Foo Bar");
$expected =
array(
array(
'document_start',
array(),
0
),
array(
'p_open',
array(
),
0
),
array(
'plugin',
array(
'wrap_spanwrap',
array(
DOKU_LEXER_ENTER,
''
),
1
),
array(
'cdata',
array(
'Foo Bar'
),
7
),
array(
'plugin',
array(
'wrap_spanwrap',
array(
DOKU_LEXER_EXIT,
''
),
DOKU_LEXER_EXIT,
''
),
32
),
array(
'cdata',
array(
''
),
39
),
array(
'p_close',
array(),
39
),
array(
'document_end',
array(),
39
)
);
$this->assertEquals($expected, $instructions);
}
}