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


PHP MockInterface::get方法代碼示例

本文整理匯總了PHP中Mockery\MockInterface::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP MockInterface::get方法的具體用法?PHP MockInterface::get怎麽用?PHP MockInterface::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Mockery\MockInterface的用法示例。


在下文中一共展示了MockInterface::get方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testDecrypt

 public function testDecrypt()
 {
     $cipherText1 = $this->getFaker()->unique()->word;
     $plainText1 = $this->getFaker()->unique()->word;
     $this->cipherRegistry->get($this->cipher1Name)->shouldReceive('decipher')->once()->with($cipherText1, $this->keySource->get($this->key1Name))->andReturn($plainText1);
     $this->serializerDeserializer->shouldReceive('deserialize')->once()->with($cipherText1)->andReturn(new CipherText($cipherText1, $this->profileRegistry->get($this->profile1Name)));
     $this->assertEquals($plainText1, $this->encryptor->decrypt($cipherText1));
     $this->cipherRegistry->get($this->cipher1Name)->shouldReceive('decipher')->once()->with($cipherText1, $this->keySource->get($this->key1Name))->andReturn($plainText1);
     $this->serializerDeserializer->shouldReceive('deserialize')->once()->with($cipherText1)->andReturn(new CipherText($cipherText1, $this->profileRegistry->get($this->profile1Name)));
     $this->assertEquals($plainText1, $this->encryptor->decrypt($cipherText1, $this->profile1Name));
     $cipherText2 = $this->getFaker()->unique()->word;
     $plainText2 = $this->getFaker()->unique()->word;
     $this->cipherRegistry->get($this->cipher2Name)->shouldReceive('decipher')->once()->with($cipherText2, $this->keySource->get($this->key2Name))->andReturn($plainText2);
     $this->assertEquals($plainText2, $this->encryptor->decrypt(new CipherText($cipherText2, $this->profileRegistry->get($this->profile2Name))));
 }
開發者ID:SaveYa,項目名稱:Encryption,代碼行數:15,代碼來源:EncryptorTest.php

示例2: testCreateDriver

 public function testCreateDriver()
 {
     /** @var m\MockInterface $driver_factory */
     $driver_factory = $this->driverFactoryRegistry->get('selenium2');
     $driver_factory->shouldReceive('createDriver')->with($this->browser)->once()->andReturn('OK');
     $this->assertEquals('OK', $this->browser->createDriver());
 }
開發者ID:mablae,項目名稱:phpunit-mink,代碼行數:7,代碼來源:BrowserConfigurationTest.php

示例3: testGettingNonExisting

 /**
  * @expectedException \OutOfBoundsException
  * @expectedExceptionMessage No driver factory for "test" driver.
  */
 public function testGettingNonExisting()
 {
     $this->_driverFactoryRegistry->get('test');
 }
開發者ID:mablae,項目名稱:phpunit-mink,代碼行數:8,代碼來源:DriverFactoryRegistryTest.php


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