]> git.mxchange.org Git - friendica.git/commitdiff
Fix expand_acl tests
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 16 Jul 2019 04:27:42 +0000 (00:27 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 30 Jul 2019 00:31:48 +0000 (20:31 -0400)
- Space containing values aren't valid anymore
- Return values are strings

tests/include/TextTest.php

index e516fe824ae3e8e23cfe24f2551fbfbee44ba2cd..5676da8f62e4a3ee6ff9a58e8ceb7fe42d3ab132 100644 (file)
@@ -5,6 +5,7 @@
 
 namespace Friendica\Test;
 
+use Friendica\Model\Group;
 use PHPUnit\Framework\TestCase;
 
 /**
@@ -55,8 +56,8 @@ class TextTest extends TestCase
         */
        public function testExpandAclNormal()
        {
-               $text='<1><2><3>';
-               $this->assertEquals(array(1, 2, 3), expand_acl($text));
+               $text='<1><2><3><' . Group::FOLLOWERS . '><' . Group::MUTUALS . '>';
+               $this->assertEquals(array('1', '2', '3', Group::FOLLOWERS, Group::MUTUALS), expand_acl($text));
        }
 
        /**
@@ -64,8 +65,8 @@ class TextTest extends TestCase
         */
        public function testExpandAclBigNumber()
        {
-               $text='<1><'.PHP_INT_MAX.'><15>';
-               $this->assertEquals(array(1, PHP_INT_MAX, 15), expand_acl($text));
+               $text='<1><' . PHP_INT_MAX . '><15>';
+               $this->assertEquals(array('1', (string)PHP_INT_MAX, '15'), expand_acl($text));
        }
 
        /**
@@ -76,7 +77,7 @@ class TextTest extends TestCase
        public function testExpandAclString()
        {
                $text="<1><279012><tt>";
-               $this->assertEquals(array(1, 279012), expand_acl($text));
+               $this->assertEquals(array('1', '279012'), expand_acl($text));
        }
 
        /**
@@ -87,7 +88,7 @@ class TextTest extends TestCase
        public function testExpandAclSpace()
        {
                $text="<1><279 012><32>";
-               $this->assertEquals(array(1, "279", "32"), expand_acl($text));
+               $this->assertEquals(array('1', '32'), expand_acl($text));
        }
 
        /**
@@ -174,7 +175,7 @@ class TextTest extends TestCase
        public function testExpandAclEmptyMatch()
        {
                $text="<1><><3>";
-               $this->assertEquals(array(1,3), expand_acl($text));
+               $this->assertEquals(array('1', '3'), expand_acl($text));
        }
 
        /**