Exemple #1
0
 /**
  * @test
  */
 public function save_captcha_code_to_session()
 {
     $length = 3;
     $cap = new Captcha(CaptchaConfig::instance(array('stringLength' => $length)));
     ob_start();
     $cap->output();
     ob_end_clean();
     $this->assertTrue(isset($_SESSION['captcha_code']));
     $this->assertEquals($length, mb_strlen($_SESSION['captcha_code']));
 }
Exemple #2
0
<?php

session_start();
require_once 'vendor/autoload.php';
use Ackintosh\Captcha;
use Ackintosh\CaptchaConfig;
$cap = new Captcha(CaptchaConfig::instance());
$cap->output();