PSR-2 reformatting PHPDoc corrections
[htmlpurifier.git] / tests / HTMLPurifier / AttrDef / SwitchTest.php
blob4faed99c6acb4ae80778248c383ca24782c9eea6
1 <?php
3 class HTMLPurifier_AttrDef_SwitchTest extends HTMLPurifier_AttrDefHarness
6 protected $with, $without;
8 public function setUp()
10 parent::setUp();
11 generate_mock_once('HTMLPurifier_AttrDef');
12 $this->with = new HTMLPurifier_AttrDefMock();
13 $this->without = new HTMLPurifier_AttrDefMock();
14 $this->def = new HTMLPurifier_AttrDef_Switch('tag', $this->with, $this->without);
17 public function testWith()
19 $token = new HTMLPurifier_Token_Start('tag');
20 $this->context->register('CurrentToken', $token);
21 $this->with->expectOnce('validate');
22 $this->with->setReturnValue('validate', 'foo');
23 $this->assertDef('bar', 'foo');
26 public function testWithout()
28 $token = new HTMLPurifier_Token_Start('other-tag');
29 $this->context->register('CurrentToken', $token);
30 $this->without->expectOnce('validate');
31 $this->without->setReturnValue('validate', 'foo');
32 $this->assertDef('bar', 'foo');
37 // vim: et sw=4 sts=4