Completed
Push — develop ( 4002e6...6c7b5f )
by Novikov
01:33
created

SFTPTest::testGetRemoteFilesList()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 1
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace SF2Helpers\SFTPBundle\Tests\SFTP;
4
5
use SF2Helpers\SFTPBundle\SFTP\SFTP;
6
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
7
8
class SFTPTest extends WebTestCase
9
{
10
    // test credentials took from here - http://www.sftp.net/public-online-sftp-servers
11
    private $hostname = 'demo.wftpserver.com:2222';
12
    private $login    = 'demo-user';
13
    private $password = 'demo-user';
14
15
    /** @var SFTP $sftpService */
16
    private $sftpService;
17
18
    /**
19
     * Test connect()
20
     */
21
    public function testConnect()
22
    {
23
        $this->sftpService->connect($this->hostname, $this->login, $this->password);
24
    }
25
26
    /**
27
     * Test connect()
28
     */
29
    public function testGetRemoteFilesList()
30
    {
31
        $this->sftpService->connect($this->hostname, $this->login, $this->password);
32
    }
33
34
    /**
35
     * Set up fixtures for testing
36
     */
37
    public function setUp()
38
    {
39
        require_once __DIR__.'/../AppKernel.php';
40
        $kernel = new \AppKernel('test', true);
41
        $kernel->boot();
42
        $container         = $kernel->getContainer();
43
        $this->sftpService = $container->get('sf2h.sftp');
44
    }
45
}
46