@@ -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