本文整理汇总了PHP中org\bovigo\vfs\vfsStream::setUp方法的典型用法代码示例。如果您正苦于以下问题:PHP vfsStream::setUp方法的具体用法?PHP vfsStream::setUp怎么用?PHP vfsStream::setUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org\bovigo\vfs\vfsStream
的用法示例。
在下文中一共展示了vfsStream::setUp方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetPathToIssuerCert
public function testGetPathToIssuerCert()
{
vfsStream::setUp('root', null, array($nameOfClientCert = 'clientCert.pem' => '', $nameOfIssuerCert = 'issuerCert.pem' => ''));
$pathToClientCert = vfsStream::url('root/' . $nameOfClientCert);
$pathToIssuerCert = vfsStream::url('root/' . $nameOfIssuerCert);
$request = new Request($pathToClientCert, $pathToIssuerCert);
$this->assertEquals($pathToIssuerCert, $request->getPathToIssuerCert());
}
示例2: testHandleReturnsResponseIfSuccessful
/**
* @todo This can be simplified once Responses are created by a factory.
*/
public function testHandleReturnsResponseIfSuccessful()
{
$pathToResponderCert = vfsStream::newFile('issuerCert.pem')->at(vfsStream::setUp())->withContent($this->getCertInPem())->url();
$process = $this->getMockProcess();
$process->method('isSuccessful')->willReturn(true);
$process->method('setCommandLine')->will($this->returnCallback(function ($commandLine) {
// NB! This assumes the outfile is the last argument. If things go
// south, assume somone has fiddled with the argument order.
$commandLine = explode('-respout', $commandLine);
$fileName = trim(end($commandLine), '\' ');
$parser = new Asn1Parser();
$asn1 = new Asn1();
file_put_contents($fileName, $parser->encodeDER(array('responseStatus' => Asn1::OCSP_SUCCESSFUL, 'responseBytes' => array('responseType' => Asn1::OID_ID_PKIX_OCSP_BASIC, 'response' => 'MIICOTCCASGhgYYwgYMxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlBUyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMQ0wCwYDVQQLDARPQ1NQMScwJQYDVQQDDB5URVNUIG9mIFNLIE9DU1AgUkVTUE9OREVSIDIwMTExGDAWBgkqhkiG9w0BCQEWCXBraUBzay5lZRgPMjAxNDEyMjYyMzE1NDVaMGAwXjBJMAkGBSsOAwIaBQAEFJ8hzI+QiAAqq1ikY3MvViFZKzWuBBR7avJVUFy42XoIh0Gu+qIrPVtXdgIQH/v/rqwJX11SX33gZ4PrfYAAGA8yMDE0MTIyNjIzMTU0NVqhIzAhMB8GCSsGAQUFBzABAgQSBBDXw6pZv+/fMYQlxV3ACvKZMA0GCSqGSIb3DQEBBQUAA4IBAQBxe4hdQYCqR+O5wLFP1nY5HiP4w348YXfFiEvVmC9JCoaoSqmXdoner0sJxYdnOleu7/WdRAvO+hAnl73aOm0l+woGpm1fud8pl7Bz0F8cIiYL4g5xorArkdHZLwMmxi09ZzhBgM93xyOtpUj1c2onIXLEyV4ENv6DPBIAPNOVVTiaeFBVGba7g4RZxgvHWeuO+OmCAezjYJNZfXaYshvudAxaqmrhBCd3xDAYjgQlarhRn6aXpNsVRZG8NK4XW6+rH+4q+9S2ZsA6KTVkfGC218unYUkA0FswJH1JO7D+G9kooZHGIuV7SL5l4bpGwNxcbtdu+xYtNqNr4xSkHBTn')), $asn1->OCSPResponse));
}));
$responder = new Responder('http://example.com', $pathToResponderCert, null, $process);
$response = $responder->handle($this->getMockRequest());
$this->assertInstanceOf('KG\\DigiDoc\\OCSP\\Response', $response);
}