Ejemplo n.º 1
0
 public function testFileSystemComponent()
 {
     $f = new common_configuration_FileSystemComponent(__FILE__, 'r');
     $this->assertEquals($f->getLocation(), __FILE__);
     $this->assertEquals($f->getExpectedRights(), 'r');
     $this->assertEquals($f->getName(), 'tao.configuration.filesystem');
     // automatically set.
     $this->assertFalse($f->isOptional());
     $this->assertTrue($f->isReadable());
     $this->setExpectedException('common_configuration_MalformedRightsException');
     $f->setExpectedRights('fail');
     try {
         $f->setExpectedRights('rw');
         $this->pass();
     } catch (common_configuration_MalformedRightsException $e) {
         $this->fail();
     }
 }
 /**
  * Short description of method buildFileSystemComponent
  *
  * @access public
  * @author Jerome Bogaerts, <*****@*****.**>
  * @param  string location
  * @param  string expectedRights
  * @param  boolean optional
  * @return common_configuration_FileSystemComponent
  */
 public static function buildFileSystemComponent($location, $expectedRights, $optional = false)
 {
     $returnValue = null;
     $returnValue = new common_configuration_FileSystemComponent($location, $expectedRights, $optional = false);
     self::incrementFileSystemCount();
     $returnValue->setName('FileSystemComponentCheck_' . self::getFileSystemCount());
     return $returnValue;
 }