3 class HTMLPurifier_AttrDef_SwitchTest
extends HTMLPurifier_AttrDefHarness
6 protected $with, $without;
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
);
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');