/** * Create an instance of the class, sets the value property and returns the object. * @param string $value * @return \Puzzlout\Objects\Str * @throws \Exception */ public static function InitWith($value) { $instance = new Str(); $instance->value = $value; $instance->IsValid(); return $instance; }
public function testIsValidMethodGivenNullImplicitReturnsException() { try { $obj = new Str(); $result = $obj->IsValid(); } catch (\Exception $ex) { $this->assertInstanceOf('\\InvalidArgumentException', $ex); } }