Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PHP-MySQLi-Database-Class
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
PHP-MySQLi-Database-Class
Commits
851dcfe2
Commit
851dcfe2
authored
May 31, 2015
by
Alexander Butenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More tests
parent
76565db0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
6 deletions
+29
-6
dbObjectTests.php
tests/dbObjectTests.php
+23
-0
product.php
tests/models/product.php
+3
-3
user.php
tests/models/user.php
+3
-3
No files found.
tests/dbObjectTests.php
View file @
851dcfe2
...
...
@@ -222,5 +222,28 @@ if (count ($obj->errors) != 4) {
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"
;
?>
tests/models/product.php
View file @
851dcfe2
...
...
@@ -4,9 +4,9 @@ require_once("user.php");
/**
* To make IDEs autocomplete happy
*
* @property
string
id
* @property
string
userid
* @property
string
customerId
* @property
int
id
* @property
int
userid
* @property
int
customerId
* @property string productName
*/
class
product
extends
dbObject
{
...
...
tests/models/user.php
View file @
851dcfe2
...
...
@@ -4,9 +4,9 @@ require_once "product.php";
/**
* To make IDEs autocomplete happy
*
* @property
string
id
* @property
int
id
* @property string login
* @property
string
active
* @property
bool
active
* @property string customerId
* @property string firstName
* @property string lastName
...
...
@@ -14,7 +14,7 @@ require_once "product.php";
* @property string createdAt
* @property string updatedAt
* @property string expires
* @property
string
loginCount
* @property
int
loginCount
*/
class
user
extends
dbObject
{
protected
$dbTable
=
"users"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment