public function testGetOrCreateDocument()
{
$user = $this->uow->getOrCreateDocument($this->type, $this->createNode('/somepath', 'foo'));
$this->assertInstanceOf($this->type, $user);
$this->assertEquals('foo', $user->username);
$method = new \ReflectionMethod($this->uow, 'getDocumentState');
$method->setAccessible(true);
$state = $method->invoke($this->uow, $user);
$method->setAccessible(false);
$this->assertEquals(UnitOfWork::STATE_MANAGED, $state);
$this->assertEquals('/somepath', $this->uow->getDocumentId($user));
}