markTestIncomplete('This test can not be run as user root.'); return; } $this->chmod(0100); $this->validator->setOptions(array('accessTypes' => "read")); $this->assertEquals(false, $this->validator->isValid($this->_testFile)); } public function testCanDetectIfFileIsNotWritable() { if (get_current_user() == 'root') { $this->markTestIncomplete('This test can not be run as user root.'); return; } $this->chmod(0400, $this->_testFile); $this->validator->setOptions(array('accessTypes' => "write")); $this->assertEquals(false, $this->validator->isValid($this->_testFile)); } public function testCanDetectIfDirIsNotReadable() { if (get_current_user() == 'root') { $this->markTestIncomplete('This test can not be run as user root.'); return; } $this->chmod(0100, $this->_testDir); $this->validator->setOptions(array('accessTypes' => "dir,read")); $this->assertEquals(false, $this->validator->isValid($this->_testDir)); $this->chmod(0700, $this->_testDir); } public function testCanDetectIfDirIsNotWritable() { if (get_current_user() == 'root') { $this->markTestIncomplete('This test can not be run as user root.'); return; } $this->chmod(0400, $this->_testDir); $this->validator->setOptions(array('accessTypes' => "dir,write")); $this->assertEquals(false, $this->validator->isValid($this->_testDir)); $this->chmod(0700, $this->_testDir); } } }