Completed
Pull Request — master (#1)
by Jan
06:30
created

ClientFunctionalityTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 9

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 9
dl 0
loc 27
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testFunctionality() 0 22 1
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
		$crypto = new CryptographyService(__DIR__ . '/../../cert/EET_CA1_Playground-CZ00000019.key', __DIR__ . '/../../cert/EET_CA1_Playground-CZ00000019.pub');
14
		$configuration = new Configuration('CZ00000019', '273', '/5546/RO24', new EvidenceEnvironment(EvidenceEnvironment::PLAYGROUND), false);
15
		$client = new Client($crypto, $configuration, new GuzzleSoapClientDriver(new \GuzzleHttp\Client()));
16
17
		$receipt = new Receipt(
18
			true,
19
			'CZ683555118',
20
			'0/6460/ZQ42',
21
			new \DateTimeImmutable('2016-11-01 00:30:12'),
22
			3411300
23
		);
24
25
		$response = $client->send($receipt);
26
27
		$this->assertInstanceOf(EvidenceResponse::class, $response);
28
		$this->assertTrue($response->isValid());
29
		$this->assertNotNull($response->getFik());
30
		$this->assertNotNull($response->getUuid());
31
		$this->assertTrue($response->isTest());
32
	}
33
34
}
35