@@ 37-48 (lines=12) @@ | ||
34 | unset($this->configuration); |
|
35 | } |
|
36 | ||
37 | public function testContainerWithDefaultValues() |
|
38 | { |
|
39 | $loader = new MesCryptoExtension(); |
|
40 | $config = $this->getEmptyConfig(); |
|
41 | $loader->load(array($config), $this->configuration); |
|
42 | ||
43 | $this->assertHasDefinition('mes_crypto.raw_key'); |
|
44 | $this->assertSame('Defuse\Crypto\Key', $this->configuration->findDefinition('mes_crypto.raw_key') |
|
45 | ->getClass(), 'Defuse\Crypto\Key class is correct'); |
|
46 | ||
47 | $this->assertNotHasDefinition('mes_crypto.loader'); |
|
48 | } |
|
49 | ||
50 | public function testContainerWithRandomKeyAndSecret() |
|
51 | { |
|
@@ 50-61 (lines=12) @@ | ||
47 | $this->assertNotHasDefinition('mes_crypto.loader'); |
|
48 | } |
|
49 | ||
50 | public function testContainerWithRandomKeyAndSecret() |
|
51 | { |
|
52 | $loader = new MesCryptoExtension(); |
|
53 | $config = $this->getConfigWithRandomKeyAndSecret(); |
|
54 | $loader->load(array($config), $this->configuration); |
|
55 | ||
56 | $this->assertHasDefinition('mes_crypto.raw_key'); |
|
57 | $this->assertSame('Defuse\Crypto\KeyProtectedByPassword', $this->configuration->findDefinition('mes_crypto.raw_key') |
|
58 | ->getClass(), 'KeyProtectedByPassword class is correct'); |
|
59 | ||
60 | $this->assertNotHasDefinition('mes_crypto.loader'); |
|
61 | } |
|
62 | ||
63 | public function testContainerWithInternalKeyAndSecret() |
|
64 | { |
|
@@ 63-73 (lines=11) @@ | ||
60 | $this->assertNotHasDefinition('mes_crypto.loader'); |
|
61 | } |
|
62 | ||
63 | public function testContainerWithInternalKeyAndSecret() |
|
64 | { |
|
65 | $loader = new MesCryptoExtension(); |
|
66 | $config = $this->getConfigWithInternalKeyAndSecret(); |
|
67 | $loader->load(array($config), $this->configuration); |
|
68 | ||
69 | $this->assertHasDefinition('mes_crypto.raw_key'); |
|
70 | $this->assertSame('Defuse\Crypto\KeyProtectedByPassword', $this->configuration->findDefinition('mes_crypto.raw_key') |
|
71 | ->getClass(), 'Defuse\Crypto\KeyProtectedByPassword class is correct'); |
|
72 | $this->assertNotHasDefinition('mes_crypto.loader'); |
|
73 | } |
|
74 | ||
75 | public function testContainerWithExternalKeyAndSecret() |
|
76 | { |
|
@@ 75-85 (lines=11) @@ | ||
72 | $this->assertNotHasDefinition('mes_crypto.loader'); |
|
73 | } |
|
74 | ||
75 | public function testContainerWithExternalKeyAndSecret() |
|
76 | { |
|
77 | $loader = new MesCryptoExtension(); |
|
78 | $config = $this->getConfigWithExternalKey(); |
|
79 | $loader->load(array($config), $this->configuration); |
|
80 | ||
81 | $this->assertHasDefinition('mes_crypto.raw_key'); |
|
82 | $this->assertSame('Defuse\Crypto\KeyProtectedByPassword', $this->configuration->findDefinition('mes_crypto.raw_key') |
|
83 | ->getClass(), 'Defuse\Crypto\KeyProtectedByPassword class is correct'); |
|
84 | $this->assertHasDefinition('mes_crypto.loader'); |
|
85 | } |
|
86 | ||
87 | public function testContainerWithFullConfigWithExternalKey() |
|
88 | { |