3 * this test tests the contains_attribute function
8 /** required, it is the file under test */
9 require_once('include/text.php');
12 * TestCase for the contains_attribute function
14 * @author Alexander Kampmann
17 class ContainsAttributeTest extends PHPUnit_Framework_TestCase {
19 * test attribute contains
21 public function testAttributeContains1() {
22 $testAttr="class1 notclass2 class3";
23 $this->assertTrue(attribute_contains($testAttr, "class3"));
24 $this->assertFalse(attribute_contains($testAttr, "class2"));
28 * test attribute contains
30 public function testAttributeContains2() {
31 $testAttr="class1 not-class2 class3";
32 $this->assertTrue(attribute_contains($testAttr, "class3"));
33 $this->assertFalse(attribute_contains($testAttr, "class2"));
37 * test with empty input
39 public function testAttributeContainsEmpty() {
41 $this->assertFalse(attribute_contains($testAttr, "class2"));
45 * test input with special chars
47 public function testAttributeContainsSpecialChars() {
48 $testAttr="--... %\$รค() /(=?}";
49 $this->assertFalse(attribute_contains($testAttr, "class2"));