Exemple #1
0
Fichier : Test.php Projet : jasny/Q
 public function testPath()
 {
     $config = Config::with('xml:' . $this->file);
     $refl = new \ReflectionProperty($config, '_path');
     $refl->setAccessible(true);
     $path = $refl->getValue($config);
     $this->assertType('Q\\Config_File', $config);
     $this->assertEquals($this->file, (string) $path);
 }
Exemple #2
0
Fichier : data.php Projet : jasny/Q
 /**
  * Release a lock
  */
 public function unlock()
 {
     $key = null;
     if (isset($_GET['lock'])) {
         list($name, $key) = explode(':', $_GET['lock'], 2) + array(1 => null);
     }
     if (isset($_GET['name'])) {
         $name = $_GET['name'];
     }
     if (isset($_GET['key'])) {
         $key = $_GET['key'];
     }
     $lock = new Lock(Config::i()->application . '.' . $name);
     if (!$lock->release($check)) {
         HTTP::response(423);
         echo "Invalid token: You do not own that lock.";
         exit;
     }
     echo 1;
 }
Exemple #3
0
 /**
  * Tests Config::with() : where dsn is path and options['ext'] and options['transformer']
  */
 public function testWith_DsnIsPathOptExtArgTr()
 {
     $config = Config::with($this->dir, array('ext' => 'yaml', 'transformer' => 'from-mock'));
     $this->checkWithTrResult($config);
 }