| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -95,13 +95,10 @@ public function all($mask = null, $fill_with_nulls = true) | |||
| 95 | 95 | * Remove all of the keys from the attributes | |
| 96 | 96 | * that aren't in the passed mask | |
| 97 | 97 | */ | |
| 98 | - return array_merge( | ||
| 99 | - $attributes, | ||
| 100 | - array_intersect_key( | ||
| 101 | - $this->attributes, | ||
| 102 | - array_flip($mask) | ||
| 103 | - ) | ||
| 104 | - ); | ||
| 98 | + return array_intersect_key( | ||
| 99 | + $this->attributes, | ||
| 100 | + array_flip($mask) | ||
| 101 | + ) + $attributes; | ||
| 105 | 102 | } | |
| 106 | 103 | ||
| 107 | 104 | return $this->attributes; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -78,9 +78,9 @@ public function testGlobalsCreation() | |||
| 78 | 78 | public function testUniversalParams() | |
| 79 | 79 | { | |
| 80 | 80 | // Test data | |
| 81 | - $params_get = array('page' => 2, 'per_page' => 10, 'num' => 1); | ||
| 82 | - $params_post = array('first_name' => 'Trevor', 'last_name' => 'Suarez', 'num' => 2); | ||
| 83 | - $cookies = array('user' => 'Rican7', 'PHPSESSID' => 'randomstring', 'num' => 3); | ||
| 81 | + $params_get = array('page' => 2, 'per_page' => 10, 'num' => 1, 5 => 'ok', 'empty' => null, 'blank' => ''); | ||
| 82 | + $params_post = array('first_name' => 'Trevor', 'last_name' => 'Suarez', 'num' => 2, 3 => 'hmm', 4 => 'thing'); | ||
| 83 | + $cookies = array('user' => 'Rican7', 'PHPSESSID' => 'randomstring', 'num' => 3, 4 => 'dog'); | ||
| 84 | 84 | $named = array('id' => '1f8ae', 'num' => 4); | |
| 85 | 85 | ||
| 86 | 86 | // Create the request | |
@@ -104,9 +104,9 @@ public function testUniversalParams() | |||
| 104 | 104 | public function testUniversalParamsWithFilter() | |
| 105 | 105 | { | |
| 106 | 106 | // Test data | |
| 107 | - $params_get = array('page' => 2, 'per_page' => 10, 'num' => 1); | ||
| 108 | - $params_post = array('first_name' => 'Trevor', 'last_name' => 'Suarez', 'num' => 2); | ||
| 109 | - $cookies = array('user' => 'Rican7', 'PHPSESSID' => 'randomstring', 'num' => 3); | ||
| 107 | + $params_get = array('page' => 2, 'per_page' => 10, 'num' => 1, 5 => 'ok', 'empty' => null, 'blank' => ''); | ||
| 108 | + $params_post = array('first_name' => 'Trevor', 'last_name' => 'Suarez', 'num' => 2, 3 => 'hmm', 4 => 'thing'); | ||
| 109 | + $cookies = array('user' => 'Rican7', 'PHPSESSID' => 'randomstring', 'num' => 3, 4 => 'dog'); | ||
| 110 | 110 | ||
| 111 | 111 | // Create our filter and expected results | |
| 112 | 112 | $filter = array('page', 'user', 'num', 'this-key-never-showed-up-anywhere'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments