Kraken\_Unit\Filesystem\FilesystemTest::testApiCreateFile_ThrowsException_WhenLegueWriteThrowsException PHP Method

testApiCreateFile_ThrowsException_WhenLegueWriteThrowsException() public method

    public function testApiCreateFile_ThrowsException_WhenLegueWriteThrowsException()
    {
        $path = 'path';
        $contents = 'contents';
        $visibility = 'visibility';
        $expected = new Exception();
        $ex = null;
        $this->expect('put', [$path, $contents, $this->prepareConfig($visibility)])->willThrow($expected);
        try {
            $this->fs->createFile($path, $contents, $visibility);
        } catch (Exception $ex) {
        }
        $this->assertInstanceOf(WriteException::class, $ex);
        $this->assertSame($expected, $ex->getPrevious());
    }
FilesystemTest