/** * Make sure the IV generation appears to work * * @dataProvider dataMakeIv */ public function testMakeIv($mode, $length) { $crypto = new Crypto('boo moo blah', $mode); $iv1 = $crypto->makeIv(); $this->assertEquals($length, strlen($iv1), 'First IV had wrong length'); $iv2 = $crypto->makeIv(); $this->assertEquals($length, strlen($iv2), 'Second IV had wrong length'); $this->assertTrue($iv1 != $iv2, 'Generated IVs should never match'); }