예제 #1
0
 /**
  * @test
  */
 public function writeWorkerLog()
 {
     $fp = fopen('php://temp', 'w');
     $this->log->setDestination($fp);
     $prop = new \ReflectionProperty('Ackintosh\\Snidel\\Log', 'ownerPid');
     $prop->setAccessible(true);
     $prop->setValue($this->log, 1);
     $prop = new \ReflectionProperty('Ackintosh\\Snidel\\Log', 'masterPid');
     $prop->setAccessible(true);
     $prop->setValue($this->log, 1);
     $this->log->info('test');
     rewind($fp);
     $this->assertStringMatchesFormat('%s(worker)%s', fgets($fp));
 }
예제 #2
0
파일: Snidel.php 프로젝트: ackintosh/snidel
 /**
  * sets the resource for the log.
  *
  * @param   resource    $resource
  * @return  void
  * @codeCoverageIgnore
  */
 public function setLogDestination($resource)
 {
     $this->log->setDestination($resource);
 }