示例#1
0
    public function setUp()
    {
        if (!extension_loaded('gd')) {
            $this->markTestSkipped('The GD extension is not available.');
            return;
        }
        if(!function_exists("imagepng")) {
            $this->markTestSkipped("Image CAPTCHA requires PNG support");
        }
        if(!function_exists("imageftbbox")) {
            $this->markTestSkipped("Image CAPTCHA requires FT fonts support");
        }

        $this->testDir = $this->getTmpDir() . '/ZF_test_images';
        if (!is_dir($this->testDir)) {
            @mkdir($this->testDir);
        }


        $this->helper  = new ImageCaptchaHelper();
        $this->captcha = new ImageCaptcha(array(
            'sessionClass' => 'ZendTest\Captcha\TestAsset\SessionContainer',
            'imgDir'       => $this->testDir,
            'font'         => __DIR__. '/../../../../Pdf/_fonts/Vera.ttf',
        ));
        parent::setUp();
    }
示例#2
0
 public function setUp()
 {
     if (!extension_loaded('intl')) {
         $this->markTestSkipped('ext/intl not enabled');
     }
     $this->helper = new FormMonthSelectHelper();
     parent::setUp();
 }
示例#3
0
 public function setUp()
 {
     $this->helper  = new FigletCaptchaHelper();
     $this->captcha = new FigletCaptcha(array(
         'sessionClass' => 'ZendTest\Captcha\TestAsset\SessionContainer',
     ));
     parent::setUp();
 }
示例#4
0
 public function setUp()
 {
     $this->helper = new ReCaptchaHelper();
     $this->captcha = new ReCaptcha(array('sessionClass' => 'ZendTest\\Captcha\\TestAsset\\SessionContainer'));
     $service = $this->captcha->getService();
     $service->setPublicKey($this->publicKey);
     $service->setPrivateKey($this->privateKey);
     parent::setUp();
 }
示例#5
0
 public function setUp()
 {
     if (!constant('TESTS_ZEND_FORM_RECAPTCHA_SUPPORT')) {
         $this->markTestSkipped('Enable TESTS_ZEND_FORM_RECAPTCHA_SUPPORT to test PDF render');
     }
     $this->helper = new ReCaptchaHelper();
     $this->captcha = new ReCaptcha(array('sessionClass' => 'ZendTest\\Captcha\\TestAsset\\SessionContainer'));
     $service = $this->captcha->getService();
     $service->setPublicKey($this->publicKey);
     $service->setPrivateKey($this->privateKey);
     parent::setUp();
 }
示例#6
0
文件: ImageTest.php 项目: nieldm/zf2
 /**
  * Tears down the fixture, for example, close a network connection.
  * This method is called after a test is executed.
  *
  * @return void
  */
 public function tearDown()
 {
     // remove captcha images
     if (!isset($this->testDir)) {
         parent::tearDown();
         return;
     }
     foreach (new DirectoryIterator($this->testDir) as $file) {
         if (!$file->isDot() && !$file->isDir()) {
             unlink($file->getPathname());
         }
     }
     parent::tearDown();
 }
示例#7
0
 public function setUp()
 {
     $this->helper = new FormInputHelper();
     parent::setUp();
 }
 public function setUp()
 {
     $this->helper = new FormFileApcProgress();
     parent::setUp();
 }
示例#9
0
 public function setUp()
 {
     $this->helper = new FormHiddenHelper();
     parent::setUp();
 }
示例#10
0
 public function setUp()
 {
     $this->helper = new FormTextareaHelper();
     parent::setUp();
 }
示例#11
0
 public function setUp()
 {
     $this->helper = new FormDateTimeHelper();
     parent::setUp();
 }
示例#12
0
 public function setUp()
 {
     $this->helper = new FormNumberHelper();
     parent::setUp();
 }
 public function setUp()
 {
     $this->helper = new FormMultiCheckboxHelper();
     parent::setUp();
 }
示例#14
0
 public function setUp()
 {
     $this->helper = new FormPasswordHelper();
     parent::setUp();
 }
示例#15
0
 public function setUp()
 {
     $this->helper = new FormMonthSelectHelper();
     parent::setUp();
 }
示例#16
0
 public function setUp()
 {
     $this->helper = new FormCaptchaHelper();
     parent::setUp();
 }
示例#17
0
 public function setUp()
 {
     $this->helper = new FormElementErrorsHelper();
     parent::setUp();
 }