/** * @dataProvider getAlgorithms */ public function testExpiresOK($alg) { \Buuum\Encoding\Encode::$key = 'My ////new Secret Key ??? %$·"!!"·$%&'; \Buuum\Encoding\Encode::setAlgorithm($alg); $code = \Buuum\Encoding\Encode::encode(self::$data, ['expires' => 10]); $this->assertEquals(\Buuum\Encoding\Encode::decode($code), self::$data); }
public function register(Container $app) { //$app->share('mailhandler', function() use ($app){ // $config = $app->get('config'); // $paths = $config->get('paths'); // $options = $config->get('mail'); // $options['spool_directory'] = $paths['storage'] . '/spool'; // return new SwiftMailerHandler($options); //}); $config = $app->get('config'); //$r = $app->get('Symfony\Component\HttpFoundation\Request'); AppSupport::setConfig($config); //AppSupport::initialize($r->getPathInfo()); //AppSupport::loadLang($config->get('lang')); //$mail = Mail::getInstance(); //$mail->setHandler($app->get('mailhandler')); Encode::$key = $config->get('encode.key'); Encode::setAlgorithm($config->get('encode.algorithm')); DB::setCapsule($app->get('database')); }