FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
data-mapper/tests/integration/MySQL/QueryTest.php at master · g4code/data-mapper · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
g4code
/
data-mapper
Public
Notifications
You must be signed in to change notification settings
Fork
10
Star
2
Code
Issues
0
Pull requests
1
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
data-mapper
/
tests
/
integration
/
MySQL
/
QueryTest.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (28 loc) · 887 Bytes
Breadcrumbs
data-mapper
/
tests
/
integration
/
MySQL
/
QueryTest.php
Copy path
File metadata and controls
38 lines (28 loc) · 887 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace
G4
\
DataMapper
\
Test
\
Integration
\
MySQL
;
use
G4
\
DataMapper
\
Common
\
Identity
;
class
QueryTest
extends
TestCase
{
public
function
testQueryShow
()
{
$
rawData
=
$
this
->
makeMapper
()->
query
(
'
SELECT * FROM test_insert
'
);
$
this
->
assertInstanceOf
(
'
\G4\DataMapper\Common\RawData
'
,
$
rawData
);
}
public
function
testQueryInsert
()
{
$
this
->
makeMapper
()->
query
(
"
INSERT INTO test_insert (id, title, content) VALUES ('54321', 'tralala', 'tralalalala');
"
);
$
identity
=
new
Identity
();
$
identity
->
field
(
'
id
'
)
->
equal
(
54321
);
$
rawData
=
$
this
->
makeMapper
()->
find
(
$
identity
);
$
this
->
assertEquals
(
1
,
$
rawData
->
count
());
$
this
->
assertEquals
(
54321
,
$
rawData
->
getOne
()[
'
id
'
]);
}
public
function
getTableName
()
{
return
'
test_insert
'
;
}
}
Back
|
FazBrowse Home
|
New Git URL