Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into acceptHandling
Browse files Browse the repository at this point in the history
Conflicts:
	library/Zend/Http/Header/AbstractAccept.php
	library/Zend/Http/Header/AcceptEncoding.php
	library/Zend/Http/Header/AcceptLanguage.php
	tests/Zend/Http/Header/AcceptCharsetTest.php
	tests/Zend/Http/Header/AcceptEncodingTest.php
	tests/Zend/Http/Header/AcceptLanguageTest.php
	tests/Zend/Http/Header/AcceptTest.php
  • Loading branch information
Freeaqingme committed Jul 14, 2012
2 parents 083dfe5 + 72c713c commit fce24bf
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 15 deletions.
10 changes: 5 additions & 5 deletions src/AbstractWord.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ abstract class AbstractWord extends AbstractAdapter
/**#@+
* @var array Character sets
*/
static $V = array("a", "e", "i", "o", "u", "y");
static $VN = array("a", "e", "i", "o", "u", "y","2","3","4","5","6","7","8","9");
static $C = array("b","c","d","f","g","h","j","k","m","n","p","q","r","s","t","u","v","w","x","z");
static $CN = array("b","c","d","f","g","h","j","k","m","n","p","q","r","s","t","u","v","w","x","z","2","3","4","5","6","7","8","9");
public static $V = array("a", "e", "i", "o", "u", "y");
public static $VN = array("a", "e", "i", "o", "u", "y","2","3","4","5","6","7","8","9");
public static $C = array("b","c","d","f","g","h","j","k","m","n","p","q","r","s","t","u","v","w","x","z");
public static $CN = array("b","c","d","f","g","h","j","k","m","n","p","q","r","s","t","u","v","w","x","z","2","3","4","5","6","7","8","9");
/**#@-*/

/**
Expand Down Expand Up @@ -100,7 +100,7 @@ abstract class AbstractWord extends AbstractAdapter
* Error messages
* @var array
*/
protected $_messageTemplates = array(
protected $messageTemplates = array(
self::MISSING_VALUE => 'Empty captcha value',
self::MISSING_ID => 'Captcha ID field is missing',
self::BAD_CAPTCHA => 'Captcha value is wrong',
Expand Down
2 changes: 1 addition & 1 deletion src/Dumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function getLabel()

/**
* Retrieve optional view helper name to use when rendering this captcha
*
*
* @return string
*/
public function getHelperName()
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @package Zend_Captcha
* @subpackage Exception
*/
class InvalidArgumentException extends \InvalidArgumentException implements
class InvalidArgumentException extends \InvalidArgumentException implements
ExceptionInterface
{
}
6 changes: 3 additions & 3 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ abstract class Factory

/**
* Create a captcha adapter instance
*
* @param array|Traversable $options
*
* @param array|Traversable $options
* @return AdapterInterface
* @throws Exception\InvalidArgumentException for a non-array, non-Traversable $options
* @throws Exception\DomainException if class is missing or invalid
Expand Down Expand Up @@ -69,7 +69,7 @@ public static function factory($options)
$class
));
}

unset($options['class']);

if (isset($options['options'])) {
Expand Down
4 changes: 2 additions & 2 deletions src/Figlet.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct($options = null)

/**
* Retrieve the composed figlet manager
*
*
* @return FigletManager
*/
public function getFiglet()
Expand All @@ -65,7 +65,7 @@ public function generate()

/**
* Get helper name used to render captcha
*
*
* @return string
*/
public function getHelperName()
Expand Down
2 changes: 1 addition & 1 deletion src/ReCaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ReCaptcha extends AbstractAdapter
* Error messages
* @var array
*/
protected $_messageTemplates = array(
protected $messageTemplates = array(
self::MISSING_VALUE => 'Missing captcha fields',
self::ERR_CAPTCHA => 'Failed to validate captcha',
self::BAD_CAPTCHA => 'Captcha value is wrong: %value%',
Expand Down
8 changes: 8 additions & 0 deletions test/CommonWordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,12 @@ public function testLoadInvalidSessionClass()
$this->setExpectedException('Zend\Captcha\Exception\InvalidArgumentException', 'not found');
$wordAdapter->getSession();
}

public function testErrorMessages()
{
$wordAdapter = new $this->wordClass;
$this->assertFalse($wordAdapter->isValid('foo'));
$messages = $wordAdapter->getMessages();
$this->assertFalse(empty($messages));
}
}
2 changes: 1 addition & 1 deletion test/ImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function setUp()
if (isset($this->word)) {
unset($this->word);
}

$this->testDir = $this->getTmpDir() . '/ZF_test_images';
if (!is_dir($this->testDir)) {
@mkdir($this->testDir);
Expand Down
3 changes: 2 additions & 1 deletion test/ReCaptchaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

use Zend\Captcha\ReCaptcha;
use Zend\Service\ReCaptcha\ReCaptcha as ReCaptchaService;

/**
* @category Zend
* @package Zend_Captcha
Expand Down Expand Up @@ -118,6 +119,6 @@ public function testAllowsSettingThemeOptionOnServiceObject()
public function testUsesReCaptchaHelper()
{
$captcha = new ReCaptcha;
$this->assertEquals('captcha/recaptcha', $captcha->getHelperName());
$this->assertEquals('captcha/recaptcha', $captcha->getHelperName());
}
}

0 comments on commit fce24bf

Please sign in to comment.