Skip to content

Instantly share code, notes, and snippets.

@tamakiii
Created October 6, 2014 14:32
Show Gist options
  • Save tamakiii/89fdba6fbff5ef0e8af8 to your computer and use it in GitHub Desktop.
Save tamakiii/89fdba6fbff5ef0e8af8 to your computer and use it in GitHub Desktop.
<?php
use Phake;
$this->row = Phake::mock('RowInterface');
$a = clone $this->row;
$b = clone $this->row;
Phake::when($a)->export()->thenReturn('a');
Phake::when($b)->export()->thenReturn('b');
Phake::when($this->group)
->export()
->thenReturn(array($a, $b));
var_dump($this->group->export()); # => array('b', 'b')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment