diff options
Diffstat (limited to 'tests/unit/Access')
-rw-r--r-- | tests/unit/Access/AccessListTest.php | 2 | ||||
-rw-r--r-- | tests/unit/Access/PermissionRolesTest.php | 2 | ||||
-rw-r--r-- | tests/unit/Access/PermissionsTest.php | 32 |
3 files changed, 6 insertions, 30 deletions
diff --git a/tests/unit/Access/AccessListTest.php b/tests/unit/Access/AccessListTest.php index 635f09930..feb9efebd 100644 --- a/tests/unit/Access/AccessListTest.php +++ b/tests/unit/Access/AccessListTest.php @@ -185,7 +185,7 @@ class AccessListTest extends UnitTestCase { $this->assertTrue($accessListPrivate->is_private()); } - public function isprivateProvider() { + public static function isprivateProvider() { return [ 'all set' => [[ 'channel_allow_cid' => '<acid>', diff --git a/tests/unit/Access/PermissionRolesTest.php b/tests/unit/Access/PermissionRolesTest.php index 3d3cbbae5..ccd6df205 100644 --- a/tests/unit/Access/PermissionRolesTest.php +++ b/tests/unit/Access/PermissionRolesTest.php @@ -23,6 +23,7 @@ namespace Zotlabs\Tests\Unit\Access; +use PHPUnit\Framwork\Attributes\IgnoreDeprecations; use Zotlabs\Tests\Unit\UnitTestCase; use Zotlabs\Access\PermissionRoles; use phpmock\phpunit\PHPMock; @@ -35,6 +36,7 @@ use DMS\PHPUnitExtensions\ArraySubset\Assert; * * @covers Zotlabs\Access\PermissionRoles */ +#[IgnoreDeprecations] class PermissionRolesTest extends UnitTestCase { use PHPMock; diff --git a/tests/unit/Access/PermissionsTest.php b/tests/unit/Access/PermissionsTest.php index 3ab567ad0..f9cb25b64 100644 --- a/tests/unit/Access/PermissionsTest.php +++ b/tests/unit/Access/PermissionsTest.php @@ -63,14 +63,6 @@ class PermissionsTest extends UnitTestCase { // There are 17 default perms $permsCount = 17; - // Create a stub for global function t() with expectation - $t = $this->getFunctionMock('Zotlabs\Access', 't'); - $t->expects($this->exactly(2*$permsCount))->willReturnCallback( - function ($string) { - return $string; - } - ); - // static method Perms() $perms = Permissions::Perms(); @@ -97,14 +89,6 @@ class PermissionsTest extends UnitTestCase { // There are 17 default perms $permsCount = 17; - // Create a stub for global function t() with expectation - $t = $this->getFunctionMock('Zotlabs\Access', 't'); - $t->expects($this->exactly(2*$permsCount))->willReturnCallback( - function ($string) { - return $string; - } - ); - $perms = Permissions::Perms('view_'); $this->assertEquals($permsCount, count($perms)); @@ -125,9 +109,6 @@ class PermissionsTest extends UnitTestCase { * @param array $expected The expected result perms array */ public function testFilledPerms($permarr, $expected) { - // Create a stub for global function t() - $t = $this->getFunctionMock('Zotlabs\Access', 't'); - $this->assertEquals($expected, Permissions::FilledPerms($permarr)); } /** @@ -135,7 +116,7 @@ class PermissionsTest extends UnitTestCase { * * \e array Indexed array which is passed as parameter to FilledPerms() * * \e array Expected associative result array with filled perms */ - public function FilledPermsProvider() { + public static function FilledPermsProvider() { return [ 'Empty param array' => [ [], @@ -209,13 +190,6 @@ class PermissionsTest extends UnitTestCase { * @uses ::call_hooks */ public function testFilledPermsNull() { - // Create a stub for global function t() with expectation - $t = $this->getFunctionMock('Zotlabs\Access', 't'); - $t->expects($this->atLeastOnce()); - // Create a stub for global function bt() with expectations - $bt = $this->getFunctionMock('Zotlabs\Access', 'btlogger'); - $bt->expects($this->once())->with($this->equalTo('FilledPerms: null')); - $result = [ 'view_stream' => 0, 'send_stream' => 0, @@ -253,7 +227,7 @@ class PermissionsTest extends UnitTestCase { * * \e array Array with perms to test * * \e array Expected result array */ - public function OPermsProvider() { + public static function OPermsProvider() { return [ 'empty' => [ [], @@ -286,7 +260,7 @@ class PermissionsTest extends UnitTestCase { * * \e array 2nd array with perms * * \e boolean expected result for the perms comparison */ - public function permsCompareProvider() { + public static function permsCompareProvider() { return [ 'equal' => [ ['perm1' => 1, 'perm2' => 0], |