@@ 37-48 (lines=12) @@ | ||
34 | */ |
|
35 | private $keyManager; |
|
36 | ||
37 | public function testGenerateCreatesKey() |
|
38 | { |
|
39 | $this->keyGenerator->expects($this->once()) |
|
40 | ->method('generate') |
|
41 | ->with(null) |
|
42 | ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
|
43 | ->getMock())); |
|
44 | ||
45 | $key = $this->keyManager->generate(); |
|
46 | ||
47 | $this->assertInstanceOf('Mes\Security\CryptoBundle\Model\KeyInterface', $key); |
|
48 | } |
|
49 | ||
50 | public function testGeneratedFromAsciiCreatesKeyFromAscii() |
|
51 | { |
@@ 37-48 (lines=12) @@ | ||
34 | */ |
|
35 | private $keyManager; |
|
36 | ||
37 | public function testGenerateCreatesKey() |
|
38 | { |
|
39 | $this->keyManager->expects($this->once()) |
|
40 | ->method('generate') |
|
41 | ->with(null) |
|
42 | ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
|
43 | ->getMock())); |
|
44 | ||
45 | $key = $this->wrapper->generate(); |
|
46 | ||
47 | $this->assertInstanceOf('Mes\Security\CryptoBundle\Model\KeyInterface', $key); |
|
48 | } |
|
49 | ||
50 | /** |
|
51 | * @expectedException \Mes\Security\CryptoBundle\Exception\CryptoException |
|
@@ 103-113 (lines=11) @@ | ||
100 | $this->wrapper->generateFromAscii($key_encoded, $secret); |
|
101 | } |
|
102 | ||
103 | public function testGetKeyReadsKey() |
|
104 | { |
|
105 | $this->keyManager->expects($this->once()) |
|
106 | ->method('getKey') |
|
107 | ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface') |
|
108 | ->getMock())); |
|
109 | ||
110 | $key = $this->wrapper->getKey(); |
|
111 | ||
112 | $this->assertInstanceOf('Mes\Security\CryptoBundle\Model\KeyInterface', $key); |
|
113 | } |
|
114 | ||
115 | public function testSetKeyStoresKey() |
|
116 | { |