Permalink
Browse files

cs fix

  • Loading branch information...
1 parent 2f66222 commit 89a3a9d539b50acebb99704869a11ca0fb6bc88e @stefanotorresi committed Dec 11, 2012
Showing with 8 additions and 5 deletions.
  1. +8 −5 tests/ZendTest/Form/View/Helper/FormCaptchaTest.php
@@ -62,12 +62,14 @@ protected function getTmpDir()
if (null === $this->tmpDir) {
$this->tmpDir = sys_get_temp_dir();
}
+
return $this->tmpDir;
}
public function getElement()
{
$element = new CaptchaElement('foo');
+
return $element;
}
@@ -87,7 +89,7 @@ public function testPassingElementWithDumbCaptchaRendersCorrectly()
$element->setCaptcha($captcha);
$element->setAttribute('id', 'foo');
$markup = $this->helper->render($element);
- $this->assertContains($captcha->getLabel(), $markup);
+ $this->assertContains($captcha->getLabel(), $markup);
$this->assertRegExp('#<[^>]*(id="' . $element->getAttribute('id') . '")[^>]*(type="text")[^>]*>#', $markup);
$this->assertRegExp('#<[^>]*(id="' . $element->getAttribute('id') . '-hidden")[^>]*(type="hidden")[^>]*>#', $markup);
}
@@ -101,7 +103,7 @@ public function testPassingElementWithFigletCaptchaRendersCorrectly()
$element->setCaptcha($captcha);
$element->setAttribute('id', 'foo');
$markup = $this->helper->render($element);
- $this->assertContains('<pre>' . $captcha->getFiglet()->render($captcha->getWord()) . '</pre>', $markup);
+ $this->assertContains('<pre>' . $captcha->getFiglet()->render($captcha->getWord()) . '</pre>', $markup);
$this->assertRegExp('#<[^>]*(id="' . $element->getAttribute('id') . '")[^>]*(type="text")[^>]*>#', $markup);
$this->assertRegExp('#<[^>]*(id="' . $element->getAttribute('id') . '-hidden")[^>]*(type="hidden")[^>]*>#', $markup);
}
@@ -110,6 +112,7 @@ public function testPassingElementWithImageCaptchaRendersCorrectly()
{
if (!extension_loaded('gd')) {
$this->markTestSkipped('The GD extension is not available.');
+
return;
}
if (!function_exists("imagepng")) {
@@ -132,15 +135,15 @@ public function testPassingElementWithImageCaptchaRendersCorrectly()
$element = $this->getElement();
$element->setCaptcha($captcha);
$element->setAttribute('id', 'foo');
-
+
$markup = $this->helper->render($element);
-
+
$this->assertContains('<img ', $markup);
$this->assertContains($captcha->getImgUrl(), $markup);
$this->assertContains($captcha->getId(), $markup);
$this->assertRegExp('#<img[^>]*(id="' . $element->getAttribute('id') . '-image")[^>]*>#', $markup);
$this->assertRegExp('#<input[^>]*(id="' . $element->getAttribute('id') . '")[^>]*(type="text")[^>]*>#', $markup);
- $this->assertRegExp('#<input[^>]*(id="' . $element->getAttribute('id') . '-hidden")[^>]*(type="hidden")[^>]*>#', $markup);
+ $this->assertRegExp('#<input[^>]*(id="' . $element->getAttribute('id') . '-hidden")[^>]*(type="hidden")[^>]*>#', $markup);
}
public function testPassingElementWithReCaptchaRendersCorrectly()

0 comments on commit 89a3a9d

Please sign in to comment.