Added tests (84,19% of coverance) to release first stable ASAP
[activemongo.git] / tests / __SleepTest.php
blob403a0ad2b2f2f5896b38d1db11c5a5ffffd148f0
1 <?php
3 class SleepModel extends ActiveMongo
5 public $a;
6 public $b;
8 function __sleep()
10 return array('a');
14 class SleepTest extends PHPUnit_Framework_TestCase
16 function __construct()
18 try {
19 SleepModel::drop();
20 } catch (Exception $e) {}
23 function testSleep()
25 $c = new SleepModel;
26 $c->a = 5;
27 $c->b = 10;
28 $c->save();
30 $c->reset();
31 $c->where('a', 5);
32 $c->doQuery();
33 $this->assertEquals($c->a, 5);
34 $this->assertTrue(!isset($c->b));