Exemplo n.º 1
0
 /**
  * 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;
 }
Exemplo n.º 2
0
 public function testIsValidMethodGivenNullImplicitReturnsException()
 {
     try {
         $obj = new Str();
         $result = $obj->IsValid();
     } catch (\Exception $ex) {
         $this->assertInstanceOf('\\InvalidArgumentException', $ex);
     }
 }