Beispiel #1
0
 /**
  * Test the JDaemon::writeProcessIdFile method.
  */
 public function testWriteProcessIdFile()
 {
     // Get a new JDaemonInspector instance.
     $daemon = new JDaemonInspector();
     // Get the current process id and set it to the daemon instance.
     $pid = (int) posix_getpid();
     $daemon->processId = $pid;
     // Execute the writeProcessIdFile method.
     $daemon->writeProcessIdFile();
     // Check the value of the file.
     $this->assertEquals($pid, (int) file_get_contents($daemon->get('application_pid_file')), 'Line: ' . __LINE__);
     // Check the permissions on the file.
     $this->assertEquals('0644', substr(decoct(fileperms($daemon->get('application_pid_file'))), 1), 'Line: ' . __LINE__);
 }
 /**
  * Method for setting protected static $signals.
  *
  * @param   mixed  $value  The value of the property.
  *
  * @return  void.
  *
  * @since   11.3
  */
 public function setClassSignals(array $value)
 {
     self::$signals = $value;
 }