1- <?php namespace Testing ;
1+ <?php
2+
3+ namespace Testing ;
24
35use PHPUnit \Framework \TestCase ;
46
57class StringerTest extends TestCase
68{
79 public function testReverse ()
810 {
9- $ result = " azer " ;
10-
11- $ stringer = stringer (" reza " )
11+ $ result = ' azer ' ;
12+
13+ $ stringer = stringer (' reza ' )
1214 ->reverse ()
1315 ->display ();
14-
16+
1517 $ this ->assertEquals ($ result , $ stringer );
1618 }
1719
1820 public function testSubstring ()
1921 {
20- $ result = " r " ;
22+ $ result = ' r ' ;
2123
22- $ string = stringer (" reza " )
24+ $ string = stringer (' reza ' )
2325 ->substring (0 , 1 )
2426 ->display ();
2527
@@ -28,11 +30,11 @@ public function testSubstring()
2830
2931 public function testCustom ()
3032 {
31- $ result = " reza ar " ;
33+ $ result = ' reza ar ' ;
3234
33- $ string = stringer (" reza " )
35+ $ string = stringer (' reza ' )
3436 ->custom (function ($ string ) {
35- return $ string . ' ar ' ;
37+ return $ string. ' ar ' ;
3638 })
3739 ->display ();
3840
@@ -41,112 +43,110 @@ public function testCustom()
4143
4244 public function testCamelCase ()
4345 {
44- $ result = " CamelCase " ;
46+ $ result = ' CamelCase ' ;
4547
46- $ string = stringer (" camel case " )
47- ->camelCase ()
48+ $ string = stringer (' camel case ' )
49+ ->camelCase ()
4850 ->display ();
4951
5052 $ this ->assertEquals ($ result , $ string );
5153 }
5254
5355 public function testAppendFirst ()
5456 {
55- $ result = " muhamad reza " ;
57+ $ result = ' muhamad reza ' ;
5658
57- $ string = stringer (" reza " )
58- ->appendFirst (" muhamad " )
59- ->display ();
59+ $ string = stringer (' reza ' )
60+ ->appendFirst (' muhamad ' )
61+ ->display ();
6062
61- $ this ->assertEquals ($ result ,$ string );
63+ $ this ->assertEquals ($ result , $ string );
6264 }
6365
6466 public function testAppendLast ()
6567 {
66- $ result = " muhamad reza " ;
68+ $ result = ' muhamad reza ' ;
6769
68- $ string = stringer (" muhamad " )
69- ->appendLast (" reza " )
70- ->display ();
70+ $ string = stringer (' muhamad ' )
71+ ->appendLast (' reza ' )
72+ ->display ();
7173
72- $ this ->assertEquals ($ result ,$ string );
74+ $ this ->assertEquals ($ result , $ string );
7375 }
7476
7577 public function testRepeat ()
7678 {
77- $ result = " reza reza " ;
79+ $ result = ' reza reza ' ;
7880
79- $ string = stringer (" reza " )
80- ->repeat (2 ," " )
81- ->display ();
81+ $ string = stringer (' reza ' )
82+ ->repeat (2 , ' ' )
83+ ->display ();
8284
83- $ this ->assertEquals ($ result ,$ string );
85+ $ this ->assertEquals ($ result , $ string );
8486 }
8587
8688 public function testUpperFirst ()
8789 {
88- $ result = " Reza " ;
90+ $ result = ' Reza ' ;
8991
90- $ string = stringer (" reza " )
91- ->upperFirst ()
92- ->display ();
92+ $ string = stringer (' reza ' )
93+ ->upperFirst ()
94+ ->display ();
9395
94- $ this ->assertEquals ($ result ,$ string );
96+ $ this ->assertEquals ($ result , $ string );
9597 }
9698
9799 public function testLowerFirst ()
98100 {
99- $ result = " reza " ;
101+ $ result = ' reza ' ;
100102
101- $ string = stringer (" Reza " )
102- ->lowerFirst ()
103- ->display ();
103+ $ string = stringer (' Reza ' )
104+ ->lowerFirst ()
105+ ->display ();
104106
105- $ this ->assertEquals ($ result ,$ string );
107+ $ this ->assertEquals ($ result , $ string );
106108 }
107109
108110 public function testUpperLast ()
109111 {
110- $ result = " rezA " ;
112+ $ result = ' rezA ' ;
111113
112- $ string = stringer (" reza " )
113- ->upperLast ()
114- ->display ();
114+ $ string = stringer (' reza ' )
115+ ->upperLast ()
116+ ->display ();
115117
116- $ this ->assertEquals ($ result ,$ string );
118+ $ this ->assertEquals ($ result , $ string );
117119 }
118120
119121 public function testLowerLast ()
120122 {
121- $ result = " reza " ;
123+ $ result = ' reza ' ;
122124
123- $ string = stringer (" rezA " )
124- ->lowerLast ()
125- ->display ();
125+ $ string = stringer (' rezA ' )
126+ ->lowerLast ()
127+ ->display ();
126128
127- $ this ->assertEquals ($ result ,$ string );
129+ $ this ->assertEquals ($ result , $ string );
128130 }
129131
130132 public function testReplace ()
131133 {
132- $ result = " PHP is Awesome " ;
134+ $ result = ' PHP is Awesome ' ;
133135
134- $ string = stringer (" GO is Awesome " )
135- ->replace (" GO " , " PHP " )
136- ->display ();
136+ $ string = stringer (' GO is Awesome ' )
137+ ->replace (' GO ' , ' PHP ' )
138+ ->display ();
137139
138- $ this ->assertEquals ($ result ,$ string );
140+ $ this ->assertEquals ($ result , $ string );
139141 }
140142
141143 public function testDisplay ()
142144 {
143- $ var = " PHP is Awesome " ;
145+ $ var = ' PHP is Awesome ' ;
144146
145- $ string = stringer ($ var )
146- ->display ();
147+ $ string = stringer ($ var )
148+ ->display ();
147149
148- $ this ->assertEquals ($ var ,$ string );
150+ $ this ->assertEquals ($ var , $ string );
149151 }
150-
151-
152152}
0 commit comments