File tree Expand file tree Collapse file tree 5 files changed +84
-4
lines changed Expand file tree Collapse file tree 5 files changed +84
-4
lines changed Original file line number Diff line number Diff line change
1
+ language : php
2
+
3
+ php :
4
+ - 7.1
5
+ - 7.2
6
+ - 7.3
7
+ - 7.4
8
+
9
+ sudo : false
10
+
11
+ cache :
12
+ directories :
13
+ - vendor
14
+ - $HOME/.composer/cache
15
+
16
+ before_script :
17
+ - composer self-update
18
+ - composer install --no-interaction --prefer-source --dev
19
+
20
+ script :
21
+ composer test
Original file line number Diff line number Diff line change 35
35
"symfony/http-foundation" : " ^4.2"
36
36
},
37
37
"require-dev" : {
38
- "phpunit/phpunit" : " ^7" ,
39
- "jakub-onderka/php-parallel-lint" : " 0.9" ,
40
- "jakub-onderka/php-console-highlighter" : " ~0.3"
38
+ "phpunit/phpunit" : " ^7"
41
39
},
42
40
"autoload" : {
43
41
"psr-4" : {
46
44
},
47
45
"scripts" : {
48
46
"test" : [
49
- " parallel-lint . --exclude vendor --no-colors" ,
50
47
" phpunit --colors=always --verbose"
51
48
]
52
49
}
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+
3
+ <phpunit
4
+ bootstrap =" tests/bootstrap.php"
5
+ colors =" true" >
6
+ <testsuites >
7
+ <testsuite name =" loyalty-php-sdk test suite" >
8
+ <directory >tests/src/</directory >
9
+ </testsuite >
10
+ </testsuites >
11
+ <filter >
12
+ <whitelist >
13
+ <directory suffix =" .php" >src/</directory >
14
+ </whitelist >
15
+ </filter >
16
+ </phpunit >
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ require __DIR__ . "/../vendor/autoload.php " ;
4
+ date_default_timezone_set ('UTC ' );
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace B24io \Loyalty \SDK \Cards \DTO ;
6
+
7
+ use PHPUnit \Framework \TestCase ;
8
+ use Ramsey \Uuid \Uuid ;
9
+
10
+ /**
11
+ * Class FabricTest
12
+ *
13
+ * @package B24io\Loyalty\SDK\Cards\DTO
14
+ */
15
+ final class FabricTest extends TestCase
16
+ {
17
+ /**
18
+ * @covers \B24io\Loyalty\SDK\Cards\DTO\Fabric::initFromArray
19
+ */
20
+ public function testCreateCardFromArray (): void
21
+ {
22
+ $ card = [
23
+ 'number ' => '12345 ' ,
24
+ 'barcode ' => '' ,
25
+ 'status ' => 'active ' ,
26
+ 'user ' => [
27
+ 'user-id ' => '123 ' ,
28
+ ],
29
+ 'balance ' => [
30
+ 'amount ' => '1000 ' ,
31
+ 'currency ' => 'RUB ' ,
32
+ ],
33
+ 'percentage ' => '10.5 ' ,
34
+ 'created ' => (new \DateTime ())->format (\DATE_RFC3339 ),
35
+ 'modified ' => (new \DateTime ())->format (\DATE_RFC3339 ),
36
+ 'uuid ' => Uuid::uuid4 (),
37
+ ];
38
+
39
+ $ cardDto = Fabric::initFromArray ($ card );
40
+ $ this ->assertEquals ($ cardDto ->getNumber (), $ card ['number ' ]);
41
+ }
42
+ }
You can’t perform that action at this time.
0 commit comments