public function addConstant($name, $value) { if ($this->isFinalized) { throw new FinalizedMockException(); } $this->customConstants[$name] = $value; return $this; }