当前位置: 首页>>代码示例>>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;未经允许,请勿转载。