Completed
Push — master ( e9933e...972910 )
by Jan
04:27
created

ClientFunctionalityTest::testFunctionality()   B

Complexity

Conditions 2
Paths 2

Size

Total Lines 25
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 8.8571
c 0
b 0
f 0
cc 2
eloc 18
nc 2
nop 0
1
<?php declare(strict_types = 1);
2
3
namespace SlevomatEET;
4
5
use SlevomatEET\Cryptography\CryptographyService;
6
use SlevomatEET\Driver\GuzzleSoapClientDriver;
7
8
class ClientFunctionalityTest extends \PHPUnit\Framework\TestCase
9
{
10
11
	public function testFunctionality()
12
	{
13
		if (getenv('TRAVIS') !== false) {
14
			$this->markTestSkipped('EET is blocking Travis CI :(');
15
		}
16
		$crypto = new CryptographyService(__DIR__ . '/../../cert/EET_CA1_Playground-CZ00000019.key', __DIR__ . '/../../cert/EET_CA1_Playground-CZ00000019.pub');
17
		$configuration = new Configuration('CZ00000019', '273', '/5546/RO24', new EvidenceEnvironment(EvidenceEnvironment::PLAYGROUND), false);
18
		$client = new Client($crypto, $configuration, new GuzzleSoapClientDriver(new \GuzzleHttp\Client()));
19
20
		$receipt = new Receipt(
21
			true,
22
			'CZ683555118',
23
			'0/6460/ZQ42',
24
			new \DateTimeImmutable('2016-11-01 00:30:12'),
25
			3411300
26
		);
27
28
		$response = $client->send($receipt);
29
30
		$this->assertInstanceOf(EvidenceResponse::class, $response);
31
		$this->assertTrue($response->isValid());
32
		$this->assertNotNull($response->getFik());
33
		$this->assertNotNull($response->getUuid());
34
		$this->assertTrue($response->isTest());
35
	}
36
37
}
38