コード例 #1
0
ファイル: Str.php プロジェクト: puzzlout/objects
 /**
  * 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;
 }
コード例 #2
0
ファイル: StrTest.php プロジェクト: puzzlout/objects
 public function testIsValidMethodGivenNullImplicitReturnsException()
 {
     try {
         $obj = new Str();
         $result = $obj->IsValid();
     } catch (\Exception $ex) {
         $this->assertInstanceOf('\\InvalidArgumentException', $ex);
     }
 }