Code Duplication    Length = 15-15 lines in 2 locations

Tests/KeyManagerTest.php 1 location

@@ 50-64 (lines=15) @@
47
        $this->assertInstanceOf('Mes\Security\CryptoBundle\Model\KeyInterface', $key);
48
    }
49
50
    public function testGeneratedFromAsciiCreatesKeyFromAscii()
51
    {
52
        $key_encoded = 'key_encoded';
53
        $secret = 'ThisIsASecretPassword';
54
55
        $this->keyGenerator->expects($this->once())
56
                           ->method('generateFromAscii')
57
                           ->with($key_encoded, $secret)
58
                           ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
59
                                                          ->getMock()));
60
61
        $key = $this->keyManager->generateFromAscii($key_encoded, $secret);
62
63
        $this->assertInstanceOf('Mes\Security\CryptoBundle\Model\KeyInterface', $key);
64
    }
65
66
    public function testGetKeyReadsNotExistingKey()
67
    {

Tests/KeyManagerWrapperTest.php 1 location

@@ 67-81 (lines=15) @@
64
        $this->wrapper->generate();
65
    }
66
67
    public function testGenerateFromAsciiCreatesKeyFromAscii()
68
    {
69
        $key_encoded = 'key_encoded';
70
        $secret = 'ThisIsASecretPassword';
71
72
        $this->keyManager->expects($this->once())
73
                         ->method('generateFromAscii')
74
                         ->with($key_encoded, $secret)
75
                         ->will($this->returnValue($this->getMockBuilder('Mes\Security\CryptoBundle\Model\KeyInterface')
76
                                                        ->getMock()));
77
78
        $key = $this->wrapper->generateFromAscii($key_encoded, $secret);
79
80
        $this->assertInstanceOf('Mes\Security\CryptoBundle\Model\KeyInterface', $key);
81
    }
82
83
    /**
84
     * @expectedException \Mes\Security\CryptoBundle\Exception\CryptoException