Total Complexity | 4 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
15 | class HashTest extends TestCase |
||
16 | { |
||
17 | private DummyGenerator $generator; |
||
18 | |||
19 | public function setUp(): void |
||
20 | { |
||
21 | parent::setUp(); |
||
22 | |||
23 | $container = new DefinitionContainer([]); |
||
24 | $container->add(RandomizerInterface::class, Randomizer::class); |
||
25 | $container->add(HashExtensionInterface::class, Hash::class); |
||
26 | $this->generator = new DummyGenerator($container); |
||
27 | } |
||
28 | |||
29 | public function testMd5(): void |
||
30 | { |
||
31 | self::assertEquals(32, strlen($this->generator->md5())); |
||
32 | } |
||
33 | |||
34 | public function testSha1(): void |
||
35 | { |
||
36 | self::assertEquals(40, strlen($this->generator->sha1())); |
||
37 | } |
||
38 | |||
39 | public function testSha256(): void |
||
40 | { |
||
41 | self::assertEquals(64, strlen($this->generator->sha256())); |
||
42 | } |
||
43 | } |