Permalink
Browse files

Test input annotation

  • Loading branch information...
1 parent ec476fd commit 4e91f8dc32e8e78db4a3ff011bd9f3425c275ee9 @thestanislav committed Aug 28, 2013
@@ -243,4 +243,15 @@ public function testObjectElementAnnotation()
$this->assertInstanceOf("Zend\Stdlib\Hydrator\ClassMethods",$fieldset->getHydrator());
$this->assertFalse($fieldset->getHydrator()->getUnderscoreSeparatedKeys());
}
+
+ public function testInputFilterInputAnnotation()
+ {
+ $entity = new TestAsset\Annotation\EntityWithInputFilterInput();
+ $builder = new Annotation\AnnotationBuilder();
+ $form = $builder->createForm($entity);
+ $inputFilter = $form->getInputFilter();
+
+ $this->assertTrue($inputFilter->has('input'));
+ $this->assertInstanceOf('ZendTest\Form\TestAsset\Annotation\InputFilterInput', $inputFilter->get('input'));
+ }
}
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Zend Framework (http://framework.zend.com/)
+ *
+ * @link http://github.com/zendframework/zf2 for the canonical source repository
+ * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @package Zend_Form
+ */
+
+namespace ZendTest\Form\TestAsset\Annotation;
+
+use Zend\Form\Annotation;
+
+class EntityWithInputFilterInput{
+
+ /**
+ * @Annotation\Input("ZendTest\Form\TestAsset\Annotation\InputFilterInput")
+ */
+ public $input;
+}
@@ -0,0 +1,17 @@
+<?php
+/**
+ * Zend Framework (http://framework.zend.com/)
+ *
+ * @link http://github.com/zendframework/zf2 for the canonical source repository
+ * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @package Zend_Form
+ */
+
+namespace ZendTest\Form\TestAsset\Annotation;
+
+use Zend\InputFilter\Input as Ancestor;
+
+class InputFilterInput extends Ancestor
+{
+}

0 comments on commit 4e91f8d

Please sign in to comment.