Make all of the tests work on all PHP versions.
[htmlpurifier.git] / tests / HTMLPurifier / AttrDef / SwitchTest.php
blob21bafe697f833da9115f3607f1ad07225a4e6c63
1 <?php
3 class HTMLPurifier_AttrDef_SwitchTest extends HTMLPurifier_AttrDefHarness
6 protected $with, $without;
8 function setUp() {
9 parent::setUp();
10 generate_mock_once('HTMLPurifier_AttrDef');
11 $this->with = new HTMLPurifier_AttrDefMock();
12 $this->without = new HTMLPurifier_AttrDefMock();
13 $this->def = new HTMLPurifier_AttrDef_Switch('tag', $this->with, $this->without);
16 function testWith() {
17 $token = new HTMLPurifier_Token_Start('tag');
18 $this->context->register('CurrentToken', $token);
19 $this->with->expectOnce('validate');
20 $this->with->setReturnValue('validate', 'foo');
21 $this->assertDef('bar', 'foo');
24 function testWithout() {
25 $token = new HTMLPurifier_Token_Start('other-tag');
26 $this->context->register('CurrentToken', $token);
27 $this->without->expectOnce('validate');
28 $this->without->setReturnValue('validate', 'foo');
29 $this->assertDef('bar', 'foo');
34 // vim: et sw=4 sts=4