/** * @test */ public function shouldThrowExceptionWhenStyleIsInValid() { //when try { IsValid::style('INVALID_STYLE'); $this->assertFalse(true, 'Triggered when exception is not throw'); } catch (InvalidArgumentException $e) { //then $this->assertEquals('Invalid style [INVALID_STYLE] available styles: [RPC, DOCUMENT]', $e->getMessage()); $this->assertInstanceOf('\\InvalidArgumentException', $e); } }
/** * @param string $style * @return $this * @throws InvalidArgumentException */ public function setStyle($style) { IsValid::style($style); $this->style = $style; return $this; }