public function testBindAllCapturedValuePostMatch() { $value1 = array(new stdClass()); $value2 = array(new stdClass()); $value3 = array(new stdClass()); $this->captor->doArgumentsMatch($value1); $this->captor->doArgumentsMatch($value2); $this->captor->doArgumentsMatch($value3); $this->captor->bindAllCapturedValues($allCaptures); $this->assertSame($this->refVariable, $value3[0]); $this->assertSame(array($value1[0], $value2[0], $value3[0]), $allCaptures); }
/** * Returns a capturing matcher that is bound to store ALL of its calls in the variable passed in. * * $value will initially be set to an empty array; * * @param mixed $value - Will be set to the value of the called argument. * * @return Phake_Matchers_ArgumentCaptor */ public static function captureAll(&$value) { $ignore = null; $captor = new Phake_Matchers_ArgumentCaptor($ignore); $captor->bindAllCapturedValues($value); return $captor; }