Browse files

Functional testing changes

- Updated configuration
- Call $form->prepare() in view script
- Ensure interfaces are correct
  • Loading branch information...
1 parent bce3aaf commit 979c1b88b2c11f8b694e102f1cc4830dbe7e57ab @weierophinney weierophinney committed May 10, 2012
View
2 Module.php
@@ -14,6 +14,8 @@ public function init($manager)
$shared = $events->getStaticConnections();
} elseif (method_exists($events, 'getSharedCollections')) {
$shared = $events->getSharedCollections();
+ } elseif (method_exists($events, 'getSharedManager')) {
+ $shared = $events->getSharedManager();
} else {
return;
}
View
20 config/module.config.php
@@ -20,7 +20,7 @@
'required' => true,
'transport' => array(
'required' => true,
- 'type' => 'Zend\Mail\Transport',
+ 'type' => 'Zend\Mail\Transport\TransportInterface',
),
),
),
@@ -33,7 +33,14 @@
),
'captchaAdapter' => array(
'required' => true,
- 'type' => 'Zend\Captcha\Adapter',
+ 'type' => 'Zend\Captcha\AdapterInterface',
+ ),
+ ),
+ 'setInputFilter' => array(
+ 'required' => true,
+ 'inputFilter' => array(
+ 'required' => true,
+ 'type' => 'PhlyContact\Form\ContactFilter',
),
),
),
@@ -42,7 +49,7 @@
'required' => true,
'captchaAdapter' => array(
'required' => true,
- 'type' => 'Zend\Captcha\Adapter',
+ 'type' => 'Zend\Captcha\AdapterInterface',
),
),
),
@@ -109,9 +116,8 @@
)),
'instance' => array(
'preferences' => array(
- 'Zend\InputFilter\InputFilterInterface' => 'PhlyContact\Form\ContactFilter',
- 'Zend\Mail\Transport' => 'Zend\Mail\Transport\Sendmail',
- 'Zend\Captcha\Adapter' => 'Zend\Captcha\Dumb',
+ 'Zend\Mail\Transport\TransportInterface' => 'Zend\Mail\Transport\Sendmail',
+ 'Zend\Captcha\AdapterInterface' => 'Zend\Captcha\Dumb',
),
// Defaults for mail message... these will clue the end-user in that
@@ -157,7 +163,7 @@
)),
// Routes
- 'Zend\Mvc\Router\RouteStack' => array('parameters' => array(
+ 'Zend\Mvc\Router\RouteStackInterface' => array('parameters' => array(
'routes' => array(
'contact' => array(
'type' => 'Literal',
View
2 src/PhlyContact/Controller/ContactController.php
@@ -19,7 +19,7 @@ public function setMessage(Message $message)
$this->message = $message;
}
- public function setMailTransport(Transport $transport)
+ public function setMailTransport(Transport\TransportInterface $transport)
{
$this->transport = $transport;
}
View
6 src/PhlyContact/Form/ContactForm.php
@@ -1,7 +1,7 @@
<?php
namespace PhlyContact\Form;
-use Zend\Captcha\Adapter as CaptchaAdapter;
+use Zend\Captcha\AdapterInterface as CaptchaAdapter;
use Zend\Form\Element;
use Zend\Form\Form;
@@ -60,12 +60,12 @@ public function init()
$this->add(new Element\Csrf('csrf'));
- $this->add($factory->createElement(array(
+ $this->add(array(
'name' => 'Send',
'attributes' => array(
'type' => 'submit',
'value' => 'Send',
),
- )));
+ ));
}
}
View
1 view/phly-contact/contact/index.phtml
@@ -17,6 +17,7 @@
<?php
$form = $this->form;
+$form->prepare();
$form->setAttribute('action', $this->url('contact/process'));
$form->setAttribute('method', 'post');

0 comments on commit 979c1b8

Please sign in to comment.