mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 08:34:42 +01:00
Some more test work
- When cleaning up, make sure we're the original user. Some tests & failures leave it logged out - Some better messages
This commit is contained in:
parent
dd1a51d5fa
commit
ff50af5677
@ -77,14 +77,15 @@ class SharingBase extends LoggedInTest
|
||||
|
||||
protected function tearDown() : void
|
||||
{
|
||||
LoggedInTest::tearDownAfterClass();
|
||||
try
|
||||
{
|
||||
// Some tests may leave us logged out, which will cause failures in parent cleanup
|
||||
LoggedInTest::tearDownAfterClass();
|
||||
}
|
||||
catch(\Throwable $e) {}
|
||||
|
||||
LoggedInTest::setupBeforeClass();
|
||||
|
||||
// Re-init, since they look at user, fstab, etc.
|
||||
// Also, further tests that access the filesystem fail if we don't
|
||||
Vfs::clearstatcache();
|
||||
Vfs::init_static();
|
||||
Vfs\StreamWrapper::init_static();
|
||||
|
||||
// Need to ask about mounts, or other tests fail
|
||||
Vfs::mount();
|
||||
@ -271,8 +272,6 @@ class SharingBase extends LoggedInTest
|
||||
Vfs::$is_root = false;
|
||||
|
||||
$this->mounts[] = $path;
|
||||
Vfs::clearstatcache();
|
||||
Vfs::init_static();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -89,14 +89,9 @@ abstract class StreamWrapperBase extends LoggedInTest
|
||||
|
||||
protected function tearDown() : void
|
||||
{
|
||||
LoggedInTest::tearDownAfterClass();
|
||||
LoggedInTest::setupBeforeClass();
|
||||
|
||||
// Re-init, since they look at user, fstab, etc.
|
||||
// Also, further tests that access the filesystem fail if we don't
|
||||
Vfs::clearstatcache();
|
||||
Vfs::init_static();
|
||||
|
||||
// Make sure we're on the original user. Failures could cause us to be logged in as someone else
|
||||
$this->switchUser($GLOBALS['EGW_USER'], $GLOBALS['EGW_PASSWORD']);
|
||||
$this->mount();
|
||||
// Need to ask about mounts, or other tests fail
|
||||
Vfs::mount();
|
||||
|
||||
@ -259,7 +254,7 @@ abstract class StreamWrapperBase extends LoggedInTest
|
||||
);
|
||||
$this->assertFalse(
|
||||
file_get_contents(Vfs::PREFIX . $file),
|
||||
"Problem reading someone else's file with no permission"
|
||||
"Read someone else's file with no permission. " . Vfs::PREFIX . $file
|
||||
);
|
||||
|
||||
}
|
||||
@ -318,7 +313,7 @@ abstract class StreamWrapperBase extends LoggedInTest
|
||||
$this->assertEquals(
|
||||
$contents,
|
||||
file_get_contents(Vfs::PREFIX . $file),
|
||||
"Problem reading someone else's file with permission"
|
||||
"Problem reading contents of someone else's file (".Vfs::PREFIX . "$file) with permission"
|
||||
);
|
||||
$this->assertTrue(
|
||||
Vfs::is_readable($file),
|
||||
|
Loading…
Reference in New Issue
Block a user