public function mockFunction($function) { $function = trim(strtolower($function)); if (!in_array($function, $this->functions, true)) { $this->functions[] = $function; } return $this; }