Skip to content

Commit c14e034

Browse files
committed
add tests for getGithubKeys
1 parent b2f70be commit c14e034

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/unit/UnitySiteTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,26 @@ public function testTestValidSSHKey(bool $expected, string $key)
2929
$SITE = new UnitySite();
3030
$this->assertEquals($expected, $SITE->testValidSSHKey($key));
3131
}
32+
33+
public static function testGetGithubKeysProvider()
34+
{
35+
return [
36+
# empty
37+
["", []],
38+
# nonexistent user
39+
["asdfkljhasdflkjashdflkjashdflkasjd", []],
40+
# user with no keys
41+
["sheldor1510", []],
42+
# user with 1 key
43+
//phpcs:disable
44+
["simonLeary42", ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDGRl6JWPj+Gq2Lz9GjYdUl4/unLoFOyfgeiII1CxutpabPByRJbeuonR0zTpn51tZeYuAUOJBOeKt+Lj4i4UDGl6igpdXXSwkBXl7jxfRPwJ6WuTkDx7Z8ynwnqlDV2q089q4OX/b/uuHgsIhIBwrouKsRQaZIqTbwNMfiqQ2zl14V0KMrTPzOiwR6Q+hqSaR5Z29WKE7ff/OWzSC3/0T6avCmcCbQaRPJdVM+QC17B0vl8FzPwRjorMngwZ0cImdQ/0Ww1d12YAL7UWp1c2egfnthKP3MuQZnNF8ixsAk1eIIwTRdiI87BOoorW8NXhxXmhyheRCsFwyP4LJBqyUVoZJ0UYyk0AO4G9EStnfpiz8YXGK+M1G4tUrWgzs1cdjlHtgCWUmITtgabnYCC4141m7n4GZTk2H/lSrJcvAs3JEiwLTj1lzeGgzeSsz/XKsnOJyzjEVr2Jp3iT+J9PbQpfS0SxTCIGgxMqllovv79pfsF/zc+vaxqSShyHW7oyn7hLMHM60LO/IIX1RWGL3rD9ecXx2pXXQ1RhIkVteIi13XkFt+KW00cstFlAd3EHCoY/XorShd2jeID7tpnYlmNfotYUs6IKefvpNC0PWkh5UXFEv3SUfw4Wd8O0DiHfhkrhxn1W/GajqSIlZ5DKgPzFg8EHexv8lSa7WJg0H3YQ=="]]
45+
//phpcs:enable
46+
]
47+
}
48+
49+
#[DataProvider("testGetGithubKeysProvider")]
50+
public static function testGetGithubKeys(array $expected, string $username)
51+
{
52+
$this->assertEquals($expected, $SITE->getGithubKeys($username));
53+
}
3254
}

0 commit comments

Comments
 (0)