1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-06 14:16:32 +02:00

Classname() constructors to __construct() constructors, as per SimpleTest. Also normalized ppp declarations; no public declaration for test methods, public/protected for the rest

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1663 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2008-04-21 15:24:18 +00:00
parent 5dbd455afb
commit 59605d592b
38 changed files with 101 additions and 101 deletions

View File

@@ -7,83 +7,83 @@ class HTMLPurifier_ConfigSchema_ValidatorAtomTest extends UnitTestCase
$this->expectException(new HTMLPurifier_ConfigSchema_Exception($msg));
}
public function makeAtom($value) {
protected function makeAtom($value) {
$obj = new stdClass();
$obj->property = $value;
// Note that 'property' and 'context' are magic wildcard values
return new HTMLPurifier_ConfigSchema_ValidatorAtom('context', $obj, 'property');
}
public function testAssertIsString() {
function testAssertIsString() {
$this->makeAtom('foo')->assertIsString();
}
public function testAssertIsStringFail() {
function testAssertIsStringFail() {
$this->expectValidationException("Property in context must be a string");
$this->makeAtom(3)->assertIsString();
}
public function testAssertNotNull() {
function testAssertNotNull() {
$this->makeAtom('foo')->assertNotNull();
}
public function testAssertNotNullFail() {
function testAssertNotNullFail() {
$this->expectValidationException("Property in context must not be null");
$this->makeAtom(null)->assertNotNull();
}
public function testAssertAlnum() {
function testAssertAlnum() {
$this->makeAtom('foo2')->assertAlnum();
}
public function testAssertAlnumFail() {
function testAssertAlnumFail() {
$this->expectValidationException("Property in context must be alphanumeric");
$this->makeAtom('%a')->assertAlnum();
}
public function testAssertAlnumFailIsString() {
function testAssertAlnumFailIsString() {
$this->expectValidationException("Property in context must be a string");
$this->makeAtom(3)->assertAlnum();
}
public function testAssertNotEmpty() {
function testAssertNotEmpty() {
$this->makeAtom('foo')->assertNotEmpty();
}
public function testAssertNotEmptyFail() {
function testAssertNotEmptyFail() {
$this->expectValidationException("Property in context must not be empty");
$this->makeAtom('')->assertNotEmpty();
}
public function testAssertIsBool() {
function testAssertIsBool() {
$this->makeAtom(false)->assertIsBool();
}
public function testAssertIsBoolFail() {
function testAssertIsBoolFail() {
$this->expectValidationException("Property in context must be a boolean");
$this->makeAtom('0')->assertIsBool();
}
public function testAssertIsArray() {
function testAssertIsArray() {
$this->makeAtom(array())->assertIsArray();
}
public function testAssertIsArrayFail() {
function testAssertIsArrayFail() {
$this->expectValidationException("Property in context must be an array");
$this->makeAtom('asdf')->assertIsArray();
}
public function testAssertIsLookup() {
function testAssertIsLookup() {
$this->makeAtom(array('foo' => true))->assertIsLookup();
}
public function testAssertIsLookupFail() {
function testAssertIsLookupFail() {
$this->expectValidationException("Property in context must be a lookup array");
$this->makeAtom(array('foo' => 4))->assertIsLookup();
}
public function testAssertIsLookupFailIsArray() {
function testAssertIsLookupFailIsArray() {
$this->expectValidationException("Property in context must be an array");
$this->makeAtom('asdf')->assertIsLookup();
}