/** * @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)); }
/** * sets the resource for the log. * * @param resource $resource * @return void * @codeCoverageIgnore */ public function setLogDestination($resource) { $this->log->setDestination($resource); }