mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-09-08 22:38:56 +02:00
[Nostromo] If user is not defined, get current running user
This commit is contained in:
@@ -154,4 +154,14 @@ class RuntimeTest extends TestCase
|
||||
$process = $runtime->runLocalCommand('false');
|
||||
$this->assertFalse($process->isSuccessful());
|
||||
}
|
||||
|
||||
public function testCurrentUser()
|
||||
{
|
||||
$runtime = new Runtime();
|
||||
$userData = posix_getpwuid(posix_geteuid());
|
||||
|
||||
$this->assertTrue(is_array($userData));
|
||||
$this->assertArrayHasKey('name', $userData);
|
||||
$this->assertEquals($userData['name'], $runtime->getCurrentUser());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user