]> git.mxchange.org Git - friendica.git/commitdiff
Remove unused function attribute_contains
authorPhilipp Holzer <admin+github@philipp.info>
Tue, 22 Oct 2019 22:22:39 +0000 (00:22 +0200)
committerPhilipp Holzer <admin+github@philipp.info>
Tue, 22 Oct 2019 22:22:39 +0000 (00:22 +0200)
include/text.php
tests/include/TextTest.php

index 1b06819570ab8854b53ad0fc0ef5353139119930..216e87ed8cb58f5b92e6338446c35f03c82db050 100644 (file)
@@ -64,25 +64,6 @@ function perms2str($p) {
        return $ret;
 }
 
-/**
- *  for html,xml parsing - let's say you've got
- *  an attribute foobar="class1 class2 class3"
- *  and you want to find out if it contains 'class3'.
- *  you can't use a normal sub string search because you
- *  might match 'notclass3' and a regex to do the job is
- *  possible but a bit complicated.
- *  pass the attribute string as $attr and the attribute you
- *  are looking for as $s - returns true if found, otherwise false
- *
- * @param string $attr attribute value
- * @param string $s string to search
- * @return boolean True if found, False otherwise
- */
-function attribute_contains($attr, $s) {
-       $a = explode(' ', $attr);
-       return (count($a) && in_array($s,$a));
-}
-
 /**
  * Compare activity uri. Knows about activity namespace.
  *
index 5676da8f62e4a3ee6ff9a58e8ceb7fe42d3ab132..1137c0415d4b893af058ea52bcdef3e9d1bab1b1 100644 (file)
@@ -13,44 +13,6 @@ use PHPUnit\Framework\TestCase;
  */
 class TextTest extends TestCase
 {
-       /**
-        * test attribute contains
-        */
-       public function testAttributeContains1()
-       {
-               $testAttr="class1 notclass2 class3";
-               $this->assertTrue(attribute_contains($testAttr, "class3"));
-               $this->assertFalse(attribute_contains($testAttr, "class2"));
-       }
-
-       /**
-        * test attribute contains
-        */
-       public function testAttributeContains2()
-       {
-               $testAttr="class1 not-class2 class3";
-               $this->assertTrue(attribute_contains($testAttr, "class3"));
-               $this->assertFalse(attribute_contains($testAttr, "class2"));
-       }
-
-       /**
-        * test with empty input
-        */
-       public function testAttributeContainsEmpty()
-       {
-               $testAttr="";
-               $this->assertFalse(attribute_contains($testAttr, "class2"));
-       }
-
-       /**
-        * test input with special chars
-        */
-       public function testAttributeContainsSpecialChars()
-       {
-               $testAttr="--... %\$รค() /(=?}";
-               $this->assertFalse(attribute_contains($testAttr, "class2"));
-       }
-
        /**
         * test expand_acl, perfect input
         */