More testing. Removed Gitea actions.
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				ci/woodpecker/push/woodpecker Pipeline was successful
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	ci/woodpecker/push/woodpecker Pipeline was successful
				
			This commit is contained in:
		@@ -5,6 +5,7 @@ declare(strict_types=1);
 | 
			
		||||
namespace App\Tests;
 | 
			
		||||
 | 
			
		||||
use App\Rclone\Rclone;
 | 
			
		||||
use Psr\Log\NullLogger;
 | 
			
		||||
use PHPUnit\Framework\TestCase;
 | 
			
		||||
 | 
			
		||||
final class RcloneTest extends TestCase
 | 
			
		||||
@@ -23,26 +24,26 @@ final class RcloneTest extends TestCase
 | 
			
		||||
    public function testRclonePath(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\Exception::class);
 | 
			
		||||
        new Rclone('invalid');
 | 
			
		||||
        new Rclone(new NullLogger(), 'invalid');
 | 
			
		||||
        $this->fail('Exception was not thrown');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testRcloneInvalidVersion(): void
 | 
			
		||||
    {
 | 
			
		||||
        $this->expectException(\Exception::class);
 | 
			
		||||
        new Rclone('uname');
 | 
			
		||||
        new Rclone(new NullLogger(), 'uname');
 | 
			
		||||
        $this->fail('Exception was not thrown');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testRcloneValidVersion(): void
 | 
			
		||||
    {
 | 
			
		||||
        $rclone = new Rclone();
 | 
			
		||||
        $rclone = new Rclone(new NullLogger());
 | 
			
		||||
        $this->assertStringStartsWith('rclone', $rclone->getVersion());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testRcloneSize(): void
 | 
			
		||||
    {
 | 
			
		||||
        $rclone = new Rclone();
 | 
			
		||||
        $rclone = new Rclone(new NullLogger());
 | 
			
		||||
        $size = $rclone->getSize('temp/source');
 | 
			
		||||
        $this->assertGreaterThan(10000, $size);
 | 
			
		||||
 | 
			
		||||
@@ -54,17 +55,33 @@ final class RcloneTest extends TestCase
 | 
			
		||||
 | 
			
		||||
    public function testRcloneCopy(): void
 | 
			
		||||
    {
 | 
			
		||||
        $rclone = new Rclone();
 | 
			
		||||
        $rclone = new Rclone(new NullLogger());
 | 
			
		||||
        $rclone->copy('temp/source', 'temp/destination');
 | 
			
		||||
        $this->assertDirectoryExists('temp/destination');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
        $rclone = new Rclone();
 | 
			
		||||
    public function testRcloneCopyParam(): void
 | 
			
		||||
    {
 | 
			
		||||
        $rclone = new Rclone(new NullLogger());
 | 
			
		||||
        $rclone->copy('temp/source', 'temp/destination', ['bwlimit' => '6M']);
 | 
			
		||||
        $this->assertDirectoryExists('temp/destination');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testRcloneCopyBad(): void
 | 
			
		||||
    {
 | 
			
		||||
        $rclone = new Rclone(new NullLogger());
 | 
			
		||||
        $this->expectException(\Exception::class);
 | 
			
		||||
        $this->expectExceptionMessage("ERROR");
 | 
			
		||||
        $rclone->copy('temp/bogus-source', 'temp/bogus-destination');
 | 
			
		||||
        $this->fail('Exception was not thrown');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function testRcloneCopyBadParam(): void
 | 
			
		||||
    {
 | 
			
		||||
        $rclone = new Rclone(new NullLogger());
 | 
			
		||||
        $this->expectException(\Exception::class);
 | 
			
		||||
        $this->expectExceptionMessage("ERROR");
 | 
			
		||||
        $rclone->copy('temp/bogus-source', 'temp/bogus-destination', ['bwlimit' => '6M']);
 | 
			
		||||
        $this->fail('Exception was not thrown');
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user