Skip to content

Commit 29839f2

Browse files
Remove Yandex from default release
If you need the Yandex sync you have to install arhitector/Yandex manually.
1 parent df385cc commit 29839f2

4 files changed

Lines changed: 39 additions & 1 deletion

File tree

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"vlucas/phpdotenv": "^4.0",
6464
"google/apiclient":"^2.7",
6565
"php-opencloud/openstack": "^3.0",
66-
"arhitector/yandex": "^2.0",
6766
"microsoft/azure-storage-blob": "^1.4",
6867
"phpmailer/phpmailer": "^6.0",
6968
"google/cloud-storage": "^1.42"

tests/phpbu/Backup/Collector/YandexDiskTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class YandexDiskTest extends TestCase
3030
*/
3131
public function testCollector()
3232
{
33+
if (!class_exists('\Arhitector\Yandex\Disk')) {
34+
$this->markTestSkipped('Arhitector\Yandex\Disk not installed');
35+
}
3336
$path = '/collector/static-dir/';
3437
$filename = 'foo-%Y-%m-%d-%H_%i.txt';
3538
$target = new Target($path, $filename, strtotime('2014-12-07 04:30:57'));
@@ -91,6 +94,9 @@ function ($item) {
9194
*/
9295
private function createClosedStubByData(array $data)
9396
{
97+
if (!class_exists('\Arhitector\Yandex\Disk')) {
98+
$this->markTestSkipped('Arhitector\Yandex\Disk not installed');
99+
}
94100
$yandexDiskFileStub = $this->createMock(Closed::class);
95101

96102
$valueMap = [

tests/phpbu/Backup/File/YandexDiskTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ class YandexDiskTest extends TestCase
2929
*/
3030
public function testCreateFileWithCorrectProperties()
3131
{
32+
if (!class_exists('\Arhitector\Yandex\Disk')) {
33+
$this->markTestSkipped('Arhitector\Yandex\Disk not installed');
34+
}
3235
$file = new YandexDisk($this->prepareDiskStub(), $this->prepareClosedStub());
3336
$this->assertEquals('dump.tar.gz', $file->getFilename());
3437
$this->assertEquals('backups/dump.tar.gz', $file->getPathname());
@@ -43,6 +46,9 @@ public function testCreateFileWithCorrectProperties()
4346
*/
4447
public function testYandexDiskDeleteFile()
4548
{
49+
if (!class_exists('\Arhitector\Yandex\Disk')) {
50+
$this->markTestSkipped('Arhitector\Yandex\Disk not installed');
51+
}
4652
$yandexDiskFileStub = $this->prepareClosedStub();
4753
$yandexDiskFileStub->expects($this->once())
4854
->method('delete')
@@ -65,6 +71,9 @@ public function testYandexDiskDeleteFile()
6571
*/
6672
public function testYandexDiskDeleteFailure()
6773
{
74+
if (!class_exists('\Arhitector\Yandex\Disk')) {
75+
$this->markTestSkipped('Arhitector\Yandex\Disk not installed');
76+
}
6877
$this->expectException(Exception::class);
6978

7079
$yandexDiskFileStub = $this->prepareClosedStub();

tests/phpbu/Backup/Sync/YandexDiskTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class YandexDiskTest extends TestCase
3333
*/
3434
public function testSetUpOk()
3535
{
36+
if (!class_exists('\Arhitector\Yandex\Disk')) {
37+
$this->markTestSkipped('Arhitector\Yandex\Disk not installed');
38+
}
3639
$yandexDisk = new YandexDisk();
3740
$yandexDisk->setup([
3841
'token' => 'this-is-no-token',
@@ -50,6 +53,9 @@ public function testSetUpOk()
5053
*/
5154
public function testSlasherizePath()
5255
{
56+
if (!class_exists('\Arhitector\Yandex\Disk')) {
57+
$this->markTestSkipped('Arhitector\Yandex\Disk not installed');
58+
}
5359
$msg = "sync backup to yandex disk\n";
5460

5561
$yandexDisk = new YandexDisk();
@@ -76,6 +82,9 @@ public function testSlasherizePath()
7682
*/
7783
public function testSync()
7884
{
85+
if (!class_exists('\Arhitector\Yandex\Disk')) {
86+
$this->markTestSkipped('Arhitector\Yandex\Disk not installed');
87+
}
7988
$target = $this->createTargetMock('foo.txt', 'foo.txt.gz');
8089
$result = $this->createResultStub();
8190
$result->expects($this->once())->method('debug');
@@ -100,6 +109,9 @@ public function testSync()
100109
*/
101110
public function testSyncWithCleanup()
102111
{
112+
if (!class_exists('\Arhitector\Yandex\Disk')) {
113+
$this->markTestSkipped('Arhitector\Yandex\Disk not installed');
114+
}
103115
$target = $this->createTargetMock('foo.txt', 'foo.txt.gz');
104116
$result = $this->createResultStub();
105117
$result->expects($this->exactly(2))->method('debug');
@@ -127,6 +139,9 @@ public function testSyncWithCleanup()
127139
*/
128140
public function testSyncFail()
129141
{
142+
if (!class_exists('\Arhitector\Yandex\Disk')) {
143+
$this->markTestSkipped('Arhitector\Yandex\Disk not installed');
144+
}
130145
$this->expectException(\phpbu\App\Exception::class);
131146
$target = $this->createTargetMock('foo.txt', 'foo.txt.gz');
132147
$result = $this->createResultStub();
@@ -152,6 +167,9 @@ public function testSyncFail()
152167
*/
153168
public function testSimulate()
154169
{
170+
if (!class_exists('\Arhitector\Yandex\Disk')) {
171+
$this->markTestSkipped('Arhitector\Yandex\Disk not installed');
172+
}
155173
$yandexDisk = new YandexDisk();
156174
$yandexDisk->setup([
157175
'token' => 'this-is-no-token',
@@ -174,6 +192,9 @@ public function testSimulate()
174192
*/
175193
public function testSetUpNoToken()
176194
{
195+
if (!class_exists('\Arhitector\Yandex\Disk')) {
196+
$this->markTestSkipped('Arhitector\Yandex\Disk not installed');
197+
}
177198
$this->expectException(Exception::class);
178199
$yandexDisk = new YandexDisk();
179200
$yandexDisk->setup(['path' => '/']);
@@ -186,6 +207,9 @@ public function testSetUpNoToken()
186207
*/
187208
public function testSetUpNoPath()
188209
{
210+
if (!class_exists('\Arhitector\Yandex\Disk')) {
211+
$this->markTestSkipped('Arhitector\Yandex\Disk not installed');
212+
}
189213
$this->expectException(Exception::class);
190214
$yandexDisk = new YandexDisk();
191215
$yandexDisk->setup(['token' => 'this-is-no-token']);

0 commit comments

Comments
 (0)