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

Commit

Permalink
fixing Coding Standards for the added code
Browse files Browse the repository at this point in the history
  • Loading branch information
igor committed Sep 21, 2012
1 parent 22768c6 commit b04198f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions library/Zend/Form/Element/MultiCheckbox.php
Expand Up @@ -65,8 +65,8 @@ public function setValueOptions(array $options)

// Update InArray validator haystack
if (!is_null($this->validator)) {
$validator = $this->validator->getValidator();
$validator->setHaystack($this->getValueOptionsValues());
$validator = $this->validator->getValidator();
$validator->setHaystack($this->getValueOptionsValues());
}

return $this;
Expand Down
14 changes: 7 additions & 7 deletions tests/ZendTest/Form/Element/MultiCheckboxTest.php
Expand Up @@ -113,15 +113,15 @@ public function testInArrayValidationOfOptions($valueTests, $options)
*/
public function testInArrayValidatorHaystakIsUpdated($valueTests, $options)
{
$element = new MultiCheckboxElement('my-checkbox');
$inputSpec = $element->getInputSpecification();
$inArrayValidator=$inputSpec['validators'][0]->getValidator();
$element = new MultiCheckboxElement('my-checkbox');
$inputSpec = $element->getInputSpecification();
$inArrayValidator=$inputSpec['validators'][0]->getValidator();

$element->setAttributes(array(
'options' => $options,
$element->setAttributes(array(
'options' => $options,
));
$haystack=$inArrayValidator->getHaystack();
$this->assertCount(count($options), $haystack);
$haystack=$inArrayValidator->getHaystack();
$this->assertCount(count($options), $haystack);
}


Expand Down
16 changes: 7 additions & 9 deletions tests/ZendTest/Form/Element/SelectTest.php
Expand Up @@ -160,17 +160,15 @@ public function testInArrayValidationOfOptions($valueTests, $options)
*/
public function testInArrayValidatorHaystakIsUpdated($valueTests, $options)
{
$element = new SelectElement('my-select');
$inputSpec = $element->getInputSpecification();
$element = new SelectElement('my-select');
$inputSpec = $element->getInputSpecification();

$inArrayValidator = $inputSpec['validators'][0];
$this->assertInstanceOf('Zend\Validator\InArray', $inArrayValidator);
$inArrayValidator = $inputSpec['validators'][0];
$this->assertInstanceOf('Zend\Validator\InArray', $inArrayValidator);

$element->setAttributes(array(
'options' => $options,
));
$haystack=$inArrayValidator->getHaystack();
$this->assertCount(count($options), $haystack);
$element->setValueOptions($options);
$haystack=$inArrayValidator->getHaystack();
$this->assertCount(count($options), $haystack);
}


Expand Down

0 comments on commit b04198f

Please sign in to comment.