Skip to content

Commit 531957a

Browse files
committed
Merge pull request #337 from avbdr/master
Fix a typo. added jsonbuilder test
2 parents fe8fb79 + 5f94797 commit 531957a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

dbObject.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public function __unset ($name) {
186186
*/
187187
private function JsonBuilder () {
188188
$this->returnType = 'Json';
189-
return $return;
189+
return $this;
190190
}
191191

192192
/**

tests/dbObjectTests.php

+7
Original file line numberDiff line numberDiff line change
@@ -274,5 +274,12 @@ function createTable ($name, $data) {
274274
if (!is_array ($p->orderBy('`products`.id', 'desc')->join('user')->get(2)))
275275
echo "wrong return type2";
276276

277+
278+
$json = user::jsonBuilder()->get(null, "id, login");
279+
if ($json != '[{"id":1,"login":"user1"},{"id":2,"login":"user2"},{"id":3,"login":"user3"},{"id":4,"login":"testuser"}]') {
280+
echo "jsonbuilder fail";
281+
exit;
282+
}
283+
277284
echo "All done";
278285
?>

0 commit comments

Comments
 (0)