コード例 #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
ファイル: ReCaptchaTest.php プロジェクト: pnaq57/zf2demo
 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();
 }
コード例 #8
0
 public function setUp()
 {
     $this->helper = new FormFileApcProgress();
     parent::setUp();
 }
コード例 #9
0
ファイル: FormHiddenTest.php プロジェクト: navassouza/zf2
 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();
 }
コード例 #13
0
 public function setUp()
 {
     $this->helper = new FormMultiCheckboxHelper();
     parent::setUp();
 }
コード例 #14
0
ファイル: FormPasswordTest.php プロジェクト: navassouza/zf2
 public function setUp()
 {
     $this->helper = new FormPasswordHelper();
     parent::setUp();
 }
コード例 #15
0
 public function setUp()
 {
     $this->helper = new FormMonthSelectHelper();
     parent::setUp();
 }
コード例 #16
0
ファイル: FormCaptchaTest.php プロジェクト: haoyanfei/zf2
 public function setUp()
 {
     $this->helper = new FormCaptchaHelper();
     parent::setUp();
 }
コード例 #17
0
 public function setUp()
 {
     $this->helper = new FormElementErrorsHelper();
     parent::setUp();
 }