public function testStrongEncryptAndDecryptWithProvidedKey() { $testString = 'Hello World !'; $testkey = '123456789abcdef'; $this->serviceLocator->expects($this->at(0))->method('get')->with('config')->willReturn($this->config); $service = $this->factory->createService($this->serviceLocator); $encryptedString = $service->encrypt($testString, $testkey); $decryptedString = $service->decrypt($encryptedString, $testkey); $this->assertEquals($testString, $decryptedString); }
/** * Mock the service locator */ public function setUpServiceLocator() { $config = $this->getConfig(); $this->serviceLocatorInterface = $this->getMock('Zend\\ServiceManager\\ServiceLocatorInterface', array('get')); $this->serviceLocatorInterface->expects($this->any())->method('get')->will($this->returnValue($config)); }