Passed
Push — master ( edb799...f409da )
by Petr
07:56
created

RemoteTest::testRound()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 28
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 19
nc 1
nop 0
dl 0
loc 28
rs 9.6333
c 0
b 0
f 0
1
<?php
2
3
namespace ProtocolsTests\Fsp;
4
5
6
use CommonTestClass;
7
use kalanis\RemoteRequest\Connection;
8
use kalanis\RemoteRequest\Interfaces;
9
use kalanis\RemoteRequest\Protocols\Fsp;
10
use kalanis\RemoteRequest\Sockets;
11
use kalanis\RemoteRequest\Translations;
12
use kalanis\RemoteRequest\Wrappers;
13
14
15
class RemoteTest extends CommonTestClass
16
{
17
    /**
18
     * Direct call for testing from CLI; just comment that return
19
     * ./phpunit --testsuite FspRemote
20
     * @throws \kalanis\RemoteRequest\RequestException
21
     * @medium
22
     */
23
    public function testRound(): void
24
    {
25
        $this->assertTrue(true);
26
        return;
27
28
        $lang = new Translations();
29
        $params = Connection\Params\Factory::getForSchema($lang, Interfaces\ISchema::SCHEMA_UDP);
30
//        $params->setTarget('ftp.vslib.cz', 21);
31
//        $params->setTarget('www.720k.net', 21, 60);
32
//        $params->setTarget('fsp.720k.net', 21, 60);
33
        $params->setTarget('10.0.0.30', 54321, 10);
34
        $processor = new Connection\Processor($lang, new Sockets\Socket($lang));
35
        $query = new Fsp\Query();
36
        $answer = new Fsp\Answer($lang);
37
        $answer->canDump = true;
38
        $version = new Fsp\Query\Version($query);
39
        $version->setKey(32)->setSequence(16)->compile();
40
41
        $response = $processor->setConnectionParams($params)->setData($query)->process()->getResponse();
42
        $result = Fsp\Answer\AnswerFactory::getObject(
43
            $answer->setResponse(
44
                $response
45
            )->process()
46
        )->process();
47
48
        /** @var Fsp\Answer\Version $result */
49
        $this->assertEquals('fspd 2.8.1b29', $result->getVersion());
50
        $this->assertFalse($result->isReadOnly());
51
    }
52
53
    public function testDirList(): void
54
    {
55
        Wrappers\Fsp::register();
56
        print_r(['stats', stat('fsp://10.0.0.30:54321/deb/asyncio.pdf')]);
57
    }
58
}
59