/** * @depends testExist * @return void */ public function testChmodWithAllModes() { $modes = array('0600', '0640', '0660', '0604', '0606', '0664', '0666', '0700', '0740', '0760', '0770', '0704', '0706', '0707', '0744', '0746', '0747', '0754', '0755', '0756', '0757', '0764', '0766', '0767', '0774', '0775', '0776', '0777'); $filePath = __DIR__ . '/example.txt'; $fileObject = new File($filePath); foreach ($modes as $mode) { $this->assertTrue($fileObject->chmod($mode)); clearstatcache(); $this->assertEquals($mode, $fileObject->getPermission()); } }