Passed
Push — dev ( 22d017...e5aa74 )
by Plamen
03:43 queued 01:09
created
tests/TableTest.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      * @covers Table::prepare
31 31
      * @covers Table::confirmValue
32 32
      */
33
-    public function testprepare(){
33
+    public function testprepare() {
34 34
         $_SERVER['REQUEST_URI'] = 'test.json';
35 35
 
36 36
         //Table::prepare(true);
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      * @covers Table::error
53 53
      * @covers Table::config
54 54
      */
55
-    public function testcreate(){
55
+    public function testcreate() {
56 56
         $_SERVER['REQUEST_URI'] = 'test/users';
57 57
 
58 58
         Table::prepare();
@@ -66,14 +66,14 @@  discard block
 block discarded – undo
66 66
         Table::create($items, $orderBy, 'a');
67 67
         $this->assertSame(Table::confirmValue('t.items', $items), true);
68 68
         $this->assertSame(Table::confirmValue('t.order.col', $orderBy), true);
69
-        $err = Table::confirmValue('errors.0','Invalid orderDir (Asc/Desc): a');
70
-        $this->assertSame($err,true);
69
+        $err = Table::confirmValue('errors.0', 'Invalid orderDir (Asc/Desc): a');
70
+        $this->assertSame($err, true);
71 71
         
72 72
         Table::create($items, $orderBy, 'asc', 2);
73 73
         $this->assertSame(Table::confirmValue('t.items', $items), true);
74 74
         $this->assertSame(Table::confirmValue('t.order.col', $orderBy), true);
75 75
         $this->assertSame(Table::confirmValue('t.order.dir', 'asc'), true);
76
-        $err1 = Table::confirmValue('errors.∞','Invalid paging (<10): 2');
76
+        $err1 = Table::confirmValue('errors.∞', 'Invalid paging (<10): 2');
77 77
         $this->assertSame($err1, true);
78 78
     }
79 79
     
@@ -130,17 +130,17 @@  discard block
 block discarded – undo
130 130
     }
131 131
 
132 132
 
133
-    public static function prepare($classMethod, $setOrCheck = false){
134
-        self::$pageExtension = pathinfo($_SERVER['REQUEST_URI'], PATHINFO_EXTENSION)?:null;
133
+    public static function prepare($classMethod, $setOrCheck = false) {
134
+        self::$pageExtension = pathinfo($_SERVER['REQUEST_URI'], PATHINFO_EXTENSION) ?: null;
135 135
         $continuePreparation = $setOrCheck === false;
136
-        if($setOrCheck === true){
137
-            if(!in_array($classMethod, self::$preparePassed) && empty(self::$pageExtension)){
138
-                die("ERROR (in a ".__CLASS__." call): Please call the ".$classMethod."(); method before the page headers sent."); 
136
+        if ($setOrCheck === true) {
137
+            if (!in_array($classMethod, self::$preparePassed) && empty(self::$pageExtension)) {
138
+                die("ERROR (in a " . __CLASS__ . " call): Please call the " . $classMethod . "(); method before the page headers sent."); 
139 139
             }
140
-        } else if(!empty($setOrCheck)) {
140
+        } else if (!empty($setOrCheck)) {
141 141
             self::$pageExtension = $setOrCheck;
142 142
         } 
143
-        if(!in_array($classMethod, self::$preparePassed)){
143
+        if (!in_array($classMethod, self::$preparePassed)) {
144 144
             self::$preparePassed[] = $classMethod;
145 145
         }
146 146
         return $continuePreparation;
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,8 @@  discard block
 block discarded – undo
30 30
      * @covers Table::prepare
31 31
      * @covers Table::confirmValue
32 32
      */
33
-    public function testprepare(){
33
+    public function testprepare()
34
+    {
34 35
         $_SERVER['REQUEST_URI'] = 'test.json';
35 36
 
36 37
         //Table::prepare(true);
@@ -52,7 +53,8 @@  discard block
 block discarded – undo
52 53
      * @covers Table::error
53 54
      * @covers Table::config
54 55
      */
55
-    public function testcreate(){
56
+    public function testcreate()
57
+    {
56 58
         $_SERVER['REQUEST_URI'] = 'test/users';
57 59
 
58 60
         Table::prepare();
@@ -130,7 +132,8 @@  discard block
 block discarded – undo
130 132
     }
131 133
 
132 134
 
133
-    public static function prepare($classMethod, $setOrCheck = false){
135
+    public static function prepare($classMethod, $setOrCheck = false)
136
+    {
134 137
         self::$pageExtension = pathinfo($_SERVER['REQUEST_URI'], PATHINFO_EXTENSION)?:null;
135 138
         $continuePreparation = $setOrCheck === false;
136 139
         if($setOrCheck === true){
Please login to merge, or discard this patch.