-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.php
56 lines (45 loc) · 1.42 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
declare(strict_types=1);
require dirname(__FILE__) . '/../vendor/autoload.php';
$classGenerator = new \Micro\Library\DTO\ClassGeneratorFacadeDefault(
['./example.xml'],
'./out',
'Transfer',
'Transfer',
);
$classGenerator->generate();
require_once 'out/Simple/SimpleObjectTransfer.php';
require_once 'out/Simple/SimpleUserTransfer.php';
require_once 'out/UserTransfer.php';
$simpleObject = new \Transfer\Simple\SimpleObjectTransfer();
$simpleObject
->setWeight(9)
->setHeight(8);
$simpleUser = new \Transfer\Simple\SimpleUserTransfer();
$simpleUser
->setParent($simpleObject)
->setIp('192.168.0.1')
->setAge(19)
->setEmail('[email protected]')
->setHostname('localhost')
->setUsername('Asisyas')
->setSometext('azds')
->setUrl('//abc')
->setJson('{"test": 123}')
->setUuid('ffd4ff99-33ed-4a13-88cf-47e22de29dcc')
->setCreatedAt('2002-08-11 20:08:01')
->setUpdatedAt('2002-08-11')
->setTimezone('Europe/Minsk')
->setCardScheme('5555555555554444')
->setBic('MIDLGB22')
->setCurrency('USD')
->setIban('BY 13 NBRB 3600900000002Z00AB00')
->setIsbn('978-0-545-01022-1')
->setIssn('0378-5955')
->setIsin('US0378331005')
->setChoice('example')
;
$validator = new \Micro\Library\DTO\ValidatorFacadeDefault();
dump($validator->validate($simpleUser));
$simpleUser->setChoice([1, 'example']);
dump($validator->validate($simpleUser, 'multiple'));