Skip to content

Commit

Permalink
[hotfix/ZF-11831] Use short class names instead of full canonical nam…
Browse files Browse the repository at this point in the history
…es where appropriate
  • Loading branch information
adamlundrigan committed Oct 21, 2011
1 parent 2558573 commit 3eb340a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/Zend/Form/FormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4243,21 +4243,23 @@ public function testAddDecoratorsKeepsNonNumericKeyNames()
*/
public function testElementsOfSubFormReceiveCorrectDefaultTranslator()
{
$isEmptyKey = \Zend\Validator\NotEmpty::IS_EMPTY;

// Global default translator
$trDefault = new \Zend\Translator\Translator(array(
$trDefault = new Translator(array(
'adapter' => 'arrayAdapter',
'content' => array(
\Zend\Validator\NotEmpty::IS_EMPTY => 'Default'
$isEmptyKey => 'Default'
),
'locale' => 'en'
));
\Zend\Registry::set('Zend_Translate', $trDefault);
Registry::set('Zend_Translate', $trDefault);

// Translator to use for elements
$trElement = new \Zend\Translator\Translator(array(
$trElement = new Translator(array(
'adapter' => 'arrayAdapter',
'content' => array(
\Zend\Validator\NotEmpty::IS_EMPTY =>'Element'
$isEmptyKey =>'Element'
),
'locale' => 'en'
));
Expand All @@ -4283,12 +4285,12 @@ public function testElementsOfSubFormReceiveCorrectDefaultTranslator()
$messages = $form->getMessages();
$this->assertEquals(
'Element',
@$messages['foo'][\Zend\Validator\NotEmpty::IS_EMPTY],
@$messages['foo'][$isEmptyKey],
'Form element received wrong validator'
);
$this->assertEquals(
'Element',
@$messages['Test1']['foosub'][\Zend\Validator\NotEmpty::IS_EMPTY],
@$messages['Test1']['foosub'][$isEmptyKey],
'SubForm element received wrong validator'
);
}
Expand Down

0 comments on commit 3eb340a

Please sign in to comment.