repo.or.cz
/
activemongo.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Added tests (84,19% of coverance) to release first stable ASAP
[activemongo.git]
/
tests
/
__SleepTest.php
blob
403a0ad2b2f2f5896b38d1db11c5a5ffffd148f0
1
<
?php
2
3
class
SleepModel
extends
ActiveMongo
4
{
5
public
$a
;
6
public
$b
;
7
8
function
__sleep
()
9
{
10
return array
(
'a'
);
11
}
12
}
13
14
class
SleepTest
extends
PHPUnit_Framework_TestCase
15
{
16
function
__construct
()
17
{
18
try
{
19
SleepModel
::
drop
();
20
}
catch
(
Exception
$e
) {}
21
}
22
23
function
testSleep
()
24
{
25
$c
=
new
SleepModel
;
26
$c
->
a
=
5
;
27
$c
->
b
=
10
;
28
$c
->
save
();
29
30
$c
->
reset
();
31
$c
->
where
(
'a'
,
5
);
32
$c
->
doQuery
();
33
$this
->
assertEquals
(
$c
->
a
,
5
);
34
$this
->
assertTrue
(!
isset
(
$c
->
b
));
35
36
37
}
38
}