public function setUp()
{
$this->init();
$this->view = ViewModel::fromArray(array('name' => 'View', 'identifier' => 'ViewIdentifier', 'description' => 'Description', 'content' => ''));
$this->view->save();
$this->layout = LayoutModel::fromArray(array('name' => 'View', 'identifier' => 'LayoutIdentifier', 'description' => 'Description', 'content' => ''));
$this->layout->save();
$this->documentType = DocumentTypeModel::fromArray(array('name' => 'DocumentType', 'description' => 'description', 'icon_id' => 1, 'default_view_id' => $this->view->getId(), 'user_id' => $this->user->getId()));
$this->documentType->save();
$this->documentType->setDependencies(array($this->documentType->getId()));
$this->documentType->save();
$this->datatype = DatatypeModel::fromArray(array('name' => 'DatatypeTest', 'model' => 'Textstring'));
$this->datatype->save();
$this->tabModel = TabModel::fromArray(array('name' => 'test', 'description' => 'test', 'document_type_id' => $this->documentType->getId()));
$this->tabModel->save();
$this->property = PropertyModel::fromArray(array('name' => 'test', 'identifier' => 'test', 'description' => 'test', 'tab_id' => $this->tabModel->getId(), 'datatype_id' => $this->datatype->getId(), 'is_required' => true));
$this->property->save();
$this->config = Registry::get('Application')->getServiceManager()->get('CoreConfig');
$this->getApplicationServiceLocator()->get('ViewTemplatePathStack')->addPath(GC_TEMPLATE_PATH);
$this->getApplicationServiceLocator()->get('Auth')->clearIdentity();
}