This commit is contained in:
@ -1,6 +1,4 @@
|
||||
<?php
|
||||
namespace App\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Console\Application;
|
||||
use Symfony\Component\Console\Tester\CommandTester;
|
||||
|
24
tests/Notification/NtfyTest.php
Normal file
24
tests/Notification/NtfyTest.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use App\Notification\Ntfy;
|
||||
|
||||
use Ntfy\Server;
|
||||
use Ntfy\Client;
|
||||
use Ntfy\Message;
|
||||
final class NtfyTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @doesNotPerformAssertions
|
||||
*/
|
||||
public function testDoesSomething(): void
|
||||
{
|
||||
//Dependency
|
||||
$client = $this->createStub(Client::class);
|
||||
|
||||
$sut = new Ntfy($client);
|
||||
|
||||
$client->expects($this->once())->method('send');
|
||||
$sut->send('title','text');
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
use App\Rclone\Rclone;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class RcloneTest extends TestCase
|
||||
@ -18,26 +19,26 @@ final class RcloneTest extends TestCase
|
||||
public function testRclonePath(): void
|
||||
{
|
||||
$this->expectException(\Exception::class);
|
||||
$rclone = new \App\Rclone\Rclone('invalid');
|
||||
$rclone = new Rclone('invalid');
|
||||
$this->assertString('', $rclone->getVersion());
|
||||
}
|
||||
|
||||
public function testRcloneInvalidVersion(): void
|
||||
{
|
||||
$this->expectException(\Exception::class);
|
||||
$rclone = new \App\Rclone\Rclone('uname');
|
||||
$rclone = new Rclone('uname');
|
||||
$this->assertString('', $rclone->getVersion());
|
||||
}
|
||||
|
||||
public function testRcloneValidVersion(): void
|
||||
{
|
||||
$rclone = new \App\Rclone\Rclone();
|
||||
$rclone = new Rclone();
|
||||
$this->assertStringContainsString('rclone', $rclone->getVersion());
|
||||
}
|
||||
|
||||
public function testRcloneSize(): void
|
||||
{
|
||||
$rclone = new \App\Rclone\Rclone();
|
||||
$rclone = new Rclone();
|
||||
$size = $rclone->getSize('temp/source');
|
||||
$this->assertGreaterThan(10000, $size);
|
||||
|
||||
@ -49,11 +50,11 @@ final class RcloneTest extends TestCase
|
||||
|
||||
public function testRcloneCopy(): void
|
||||
{
|
||||
$rclone = new \App\Rclone\Rclone();
|
||||
$rclone = new Rclone();
|
||||
$result = $rclone->copy('temp/source','temp/destination');
|
||||
$this->assertDirectoryExists('temp/destination');
|
||||
|
||||
$rclone = new \App\Rclone\Rclone();
|
||||
$rclone = new Rclone();
|
||||
$result = $rclone->copy('temp/source','temp/destination',['bwlimit'=>'6M']);
|
||||
$this->assertDirectoryExists('temp/destination');
|
||||
|
||||
|
Reference in New Issue
Block a user