aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/Access/AccessListTest.php
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2023-07-12 21:38:10 +0200
committerHarald Eilertsen <haraldei@anduin.net>2023-07-12 21:38:10 +0200
commitd5c1a4998489c73acbf9121edccb1ff797331a1b (patch)
treee9f824b1e772e3ca0160e4f20951d24d5df3aa40 /tests/unit/Access/AccessListTest.php
parente80d3653c9e2aac2b114eb1c77b1e717dc90efb9 (diff)
downloadvolse-hubzilla-d5c1a4998489c73acbf9121edccb1ff797331a1b.tar.gz
volse-hubzilla-d5c1a4998489c73acbf9121edccb1ff797331a1b.tar.bz2
volse-hubzilla-d5c1a4998489c73acbf9121edccb1ff797331a1b.zip
tests: AccessListTest collect defaults in one testcase.
Just no need to have them spread around in various other tests cases.
Diffstat (limited to 'tests/unit/Access/AccessListTest.php')
-rw-r--r--tests/unit/Access/AccessListTest.php18
1 files 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());
}