File tree Expand file tree Collapse file tree 1 file changed +75
-0
lines changed Expand file tree Collapse file tree 1 file changed +75
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the PHP-UNDERSCORE package.
5
+ *
6
+ * (c) Jitendra Adhikari <[email protected] >
7
+ * <https://github.com/adhocore>
8
+ *
9
+ * Licensed under MIT license.
10
+ */
11
+
12
+ namespace Ahc \Underscore \Test ;
13
+
14
+ use Ahc \Underscore \HigherOrderMessage ;
15
+ use PHPUnit \Framework \TestCase as TestCase ;
16
+
17
+ /**
18
+ * Auto generated by `phint test`
19
+ */
20
+ class HigherOrderMessageTest extends TestCase
21
+ {
22
+ /**
23
+ * @var HigherOrderMessage
24
+ */
25
+ protected $ hom1 ;
26
+
27
+ /**
28
+ * @var HigherOrderMessage
29
+ */
30
+ protected $ hom2 ;
31
+
32
+ public function setUp ()
33
+ {
34
+ parent ::setUp ();
35
+
36
+ $ this ->hom1 = new HigherOrderMessage (
37
+ underscore ([
38
+ ['a ' => 1 , 'b ' => 2 ],
39
+ ]),
40
+ 'map '
41
+ );
42
+
43
+ $ this ->hom2 = new HigherOrderMessage (
44
+ underscore ([
45
+ new class {
46
+ public $ b = 'B ' ;
47
+
48
+ public function a ()
49
+ {
50
+ return 'A ' ;
51
+ }
52
+ }
53
+ ]),
54
+ 'map '
55
+ );
56
+ }
57
+
58
+ public function test_call ()
59
+ {
60
+ $ actual = $ this ->hom2 ->a ()->get ();
61
+
62
+ $ this ->assertSame (['A ' ], $ actual );
63
+ }
64
+
65
+ public function test_get ()
66
+ {
67
+ $ actual = $ this ->hom1 ->b ->get ();
68
+
69
+ $ this ->assertSame ([2 ], $ actual );
70
+
71
+ $ actual = $ this ->hom2 ->b ->get ();
72
+
73
+ $ this ->assertSame (['B ' ], $ actual );
74
+ }
75
+ }
You can’t perform that action at this time.
0 commit comments