Commit 851dcfe2 authored by Alexander Butenko's avatar Alexander Butenko

More tests

parent 76565db0
...@@ -222,5 +222,28 @@ if (count ($obj->errors) != 4) { ...@@ -222,5 +222,28 @@ if (count ($obj->errors) != 4) {
exit; exit;
} }
if (!user::byId(1) instanceof user)
echo "wrong return type1";
if (!is_array (user::ArrayBuilder()->byId(1)))
echo "wrong return type2";
if (!is_array (product::join('user')->orderBy('products.id', 'desc')->get(2)))
echo "wrong return type2";
if (!is_array (product::orderBy('products.id', 'desc')->join('user')->get(2)))
echo "wrong return type2";
$u = new user;
if (!$u->byId(1) instanceof user)
echo "wrong return type2";
$p = new product;
if (!is_array ($p->join('user')->orderBy('products.id', 'desc')->get(2)))
echo "wrong return type2";
if (!is_array ($p->orderBy('products.id', 'desc')->join('user')->get(2)))
echo "wrong return type2";
echo "All done"; echo "All done";
?> ?>
...@@ -4,9 +4,9 @@ require_once("user.php"); ...@@ -4,9 +4,9 @@ require_once("user.php");
/** /**
* To make IDEs autocomplete happy * To make IDEs autocomplete happy
* *
* @property string id * @property int id
* @property string userid * @property int userid
* @property string customerId * @property int customerId
* @property string productName * @property string productName
*/ */
class product extends dbObject { class product extends dbObject {
......
...@@ -4,9 +4,9 @@ require_once "product.php"; ...@@ -4,9 +4,9 @@ require_once "product.php";
/** /**
* To make IDEs autocomplete happy * To make IDEs autocomplete happy
* *
* @property string id * @property int id
* @property string login * @property string login
* @property string active * @property bool active
* @property string customerId * @property string customerId
* @property string firstName * @property string firstName
* @property string lastName * @property string lastName
...@@ -14,7 +14,7 @@ require_once "product.php"; ...@@ -14,7 +14,7 @@ require_once "product.php";
* @property string createdAt * @property string createdAt
* @property string updatedAt * @property string updatedAt
* @property string expires * @property string expires
* @property string loginCount * @property int loginCount
*/ */
class user extends dbObject { class user extends dbObject {
protected $dbTable = "users"; protected $dbTable = "users";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment