From d5c1a4998489c73acbf9121edccb1ff797331a1b Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Wed, 12 Jul 2023 21:38:10 +0200 Subject: tests: AccessListTest collect defaults in one testcase. Just no need to have them spread around in various other tests cases. --- tests/unit/Access/AccessListTest.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/unit/Access/AccessListTest.php b/tests/unit/Access/AccessListTest.php index 3c8d3e859..0ae024640 100644 --- a/tests/unit/Access/AccessListTest.php +++ b/tests/unit/Access/AccessListTest.php @@ -69,23 +69,24 @@ class AccessListTest extends UnitTestCase { // Causes: "Illegal string offset 'channel_allow_cid'" } */ - public function testDefaultGetExplicit() { + /** + * Test that the defaults are as expected when constructed with + * an empty array. + */ + public function testDefaults() { $accessList = new AccessList([]); $this->assertFalse($accessList->get_explicit()); - } + $this->assertFalse($accessList->is_private()); - public function testDefaultGet() { - $arr = [ + $expected = [ 'allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ]; - $accessList = new AccessList([]); - - $this->assertEquals($arr, $accessList->get()); + $this->assertEquals($expected, $accessList->get()); } public function testSet() { @@ -161,9 +162,6 @@ class AccessListTest extends UnitTestCase { * @dataProvider isprivateProvider */ public function testIsPrivate($channel) { - $accessListPublic = new AccessList([]); - $this->assertFalse($accessListPublic->is_private()); - $accessListPrivate = new AccessList($channel); $this->assertTrue($accessListPrivate->is_private()); } -- cgit v1.2.3