public function testInsert() { $sarah = array('_id' => new MongoId('4c04d5101f5f5e21361e3ab5'), 'name' => array('first' => 'Sarah', 'last' => 'Thomas'), 'email' => '*****@*****.**', 'sex' => 'M'); My_ShantyMongo_User::insert($sarah, array('safe' => true)); $user = My_ShantyMongo_User::find('4c04d5101f5f5e21361e3ab5'); $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_OBJECT, $user); $this->assertEquals('My_ShantyMongo_User', get_class($user)); $this->assertEquals('Sarah', $user->name->first); $users = My_ShantyMongo_User::all(); $this->assertEquals(4, $users->count()); }