public function testValidModesCanBeSet() { foreach (ExpertSenderEnum::getModes() as $mode) { $this->request->setMode($mode); $this->assertEquals($mode, $this->request->getMode()); } }
/** * @param string $mode * @return AddUserToList * @throws BadMethodCallException * @throws \InvalidArgumentException */ public function setMode($mode) { $this->exceptionIfFrozen(); if (!in_array($mode, ExpertSenderEnum::getModes())) { throw new \InvalidArgumentException('Invalid mode: ' . $mode); } $this->mode = $mode; return $this; }