Skip to content

Instantly share code, notes, and snippets.

@andriesss
Last active December 20, 2015 08:09
Show Gist options
  • Save andriesss/6098151 to your computer and use it in GitHub Desktop.
Save andriesss/6098151 to your computer and use it in GitHub Desktop.
<?php
$model = new SomeModel();
$model->setName('test');
$someService = $this->getMock('\My\Service\Some');
$someService
->expects($this->any())
->method('getAll')
->will($this->returnValue(array($model)));
$form = $this->getMock('\My\Form\Camera'); // extends Zend_Form which inits a bunch of form elements
$form
->expects($this->any())
->method('getSomeService')
->will($this->returnValue($someService));
var_dump($form->getElements()); // --> NULL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment