Ouzo\Tests\CatchException::when PHP Method

when() public static method

public static when ( $object )
    public static function when($object)
    {
        self::$exception = null;
        return new CatchExceptionObject($object);
    }

Usage Example

コード例 #1
0
ファイル: FilesTest.php プロジェクト: letsdrink/ouzo
 /**
  * @test
  */
 public function shouldThrowExceptionWhenNotFoundSourceFileToMove()
 {
     //given
     $files = new Files();
     //when
     CatchException::when($files)->move('/broken/path/file', '/broken/path/new_file');
     //then
     CatchException::assertThat()->isInstanceOf('\\Ouzo\\Utilities\\FileNotFoundException');
 }
All Usage Examples Of Ouzo\Tests\CatchException::when