public function testWriteToTmp() { $certificate = new Certificate('test'); $path = $certificate->writeToTmp(); $this->assertFileExists($path); $this->assertEquals('test', file_get_contents($path)); }
/** * @return Resource */ protected function createStreamContext() { $streamContext = stream_context_create(); if (!empty($this->caFile)) { stream_context_set_option($streamContext, 'ssl', 'cafile', $this->caFile); } stream_context_set_option($streamContext, 'ssl', 'local_cert', $this->certificate->writeToTmp()); return $streamContext; }
/** * @return Resource */ protected function createStreamContext() { $streamContext = stream_context_create(); stream_context_set_option($streamContext, 'ssl', 'local_cert', $this->certificate->writeToTmp()); return $streamContext; }