mirror of
https://github.com/Ne-Lexa/php-zip.git
synced 2025-08-01 13:10:09 +02:00
Skipped some tests for a users with root privileges
This commit is contained in:
@@ -30,6 +30,10 @@ class ZipFileTest extends ZipTestCase
|
|||||||
*/
|
*/
|
||||||
public function testOpenFileCantOpen()
|
public function testOpenFileCantOpen()
|
||||||
{
|
{
|
||||||
|
if (0 === posix_getuid()){
|
||||||
|
$this->markTestSkipped('Skip the test for a user with root privileges');
|
||||||
|
}
|
||||||
|
|
||||||
self::assertNotFalse(file_put_contents($this->outputFilename, 'content'));
|
self::assertNotFalse(file_put_contents($this->outputFilename, 'content'));
|
||||||
self::assertTrue(chmod($this->outputFilename, 0222));
|
self::assertTrue(chmod($this->outputFilename, 0222));
|
||||||
|
|
||||||
@@ -1003,6 +1007,10 @@ class ZipFileTest extends ZipTestCase
|
|||||||
*/
|
*/
|
||||||
public function testExtractFail3()
|
public function testExtractFail3()
|
||||||
{
|
{
|
||||||
|
if (0 === posix_getuid()){
|
||||||
|
$this->markTestSkipped('Skip the test for a user with root privileges');
|
||||||
|
}
|
||||||
|
|
||||||
$zipFile = new ZipFile();
|
$zipFile = new ZipFile();
|
||||||
$zipFile['file'] = 'content';
|
$zipFile['file'] = 'content';
|
||||||
$zipFile->saveAsFile($this->outputFilename);
|
$zipFile->saveAsFile($this->outputFilename);
|
||||||
@@ -1205,6 +1213,10 @@ class ZipFileTest extends ZipTestCase
|
|||||||
*/
|
*/
|
||||||
public function testAddFileCantOpen()
|
public function testAddFileCantOpen()
|
||||||
{
|
{
|
||||||
|
if (0 === posix_getuid()){
|
||||||
|
$this->markTestSkipped('Skip the test for a user with root privileges');
|
||||||
|
}
|
||||||
|
|
||||||
self::assertNotFalse(file_put_contents($this->outputFilename, ''));
|
self::assertNotFalse(file_put_contents($this->outputFilename, ''));
|
||||||
self::assertTrue(chmod($this->outputFilename, 0244));
|
self::assertTrue(chmod($this->outputFilename, 0244));
|
||||||
|
|
||||||
@@ -1489,6 +1501,10 @@ class ZipFileTest extends ZipTestCase
|
|||||||
*/
|
*/
|
||||||
public function testSaveAsFileNotWritable()
|
public function testSaveAsFileNotWritable()
|
||||||
{
|
{
|
||||||
|
if (0 === posix_getuid()){
|
||||||
|
$this->markTestSkipped('Skip the test for a user with root privileges');
|
||||||
|
}
|
||||||
|
|
||||||
self::assertTrue(mkdir($this->outputDirname, 0444, true));
|
self::assertTrue(mkdir($this->outputDirname, 0444, true));
|
||||||
self::assertTrue(chmod($this->outputDirname, 0444));
|
self::assertTrue(chmod($this->outputDirname, 0444));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user