public function testSetEmbeddedToNull() { $user = new User(); $user->setId((string) new \MongoId()); $user->setUsername('jwage'); $user->setAddress(null); $this->dm->persist($user); $this->dm->flush(); $this->dm->clear(); $userId = $user->getId(); $user = $this->dm->getRepository('Documents\\User')->find($userId); $this->assertEquals($userId, $user->getId()); $this->assertNull($user->getAddress()); }