Completed
Pull Request — master (#1)
by Jan
07:13 queued 03:59
created

ClientFunctionalityTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 9

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 9
dl 0
loc 30
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B testFunctionality() 0 25 2
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