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