當前位置: 首頁>>代碼示例>>PHP>>正文


PHP vfsStream::setUp方法代碼示例

本文整理匯總了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());
 }
開發者ID:kgilden,項目名稱:php-digidoc,代碼行數:8,代碼來源:RequestTest.php

示例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);
 }
開發者ID:kgilden,項目名稱:php-digidoc,代碼行數:21,代碼來源:ResponderTest.php


注:本文中的org\bovigo\vfs\vfsStream::setUp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。