AesTest::testEngine PHP Метод

testEngine() публичный Метод

public testEngine ( )
    public function testEngine()
    {
        $input = 'AAAAAAAA';
        $key = 'AAAAAAAA';
        $encrypted = Aes::encrypt($input, $key);
        $this->assertEquals($input, Aes::decrypt($encrypted, $key));
        // Perform a validation by replacing a random byte to make sure
        // the decryption fails. After enough successful runs,
        // all areas of the cypher text will have been tested
        // for integrity
        $corrupt = self::swaprandbyte($encrypted);
        Aes::decrypt($corrupt, $key);
    }