Gc\Datatype\AbstractDatatype\AbstractEditorTest::setUp PHP Method

setUp() protected method

This method is called before a test is executed.
protected setUp ( ) : void
return void
    protected function setUp()
    {
        $this->datatype = DatatypeModel::fromArray(array('name' => 'AbstractEditorTest', 'prevalue_value' => 's:18:"AbstractEditorTest";', 'model' => 'AbstractEditorTest'));
        $this->datatype->save();
        $this->view = ViewModel::fromArray(array('name' => 'View Name', 'identifier' => 'View identifier', 'description' => 'View Description', 'content' => 'View Content'));
        $this->view->save();
        $this->user = UserModel::fromArray(array('lastname' => 'User test', 'firstname' => 'User test', 'email' => '[email protected]', 'login' => 'test', 'user_acl_role_id' => 1));
        $this->user->setPassword('test');
        $this->user->save();
        $this->documentType = DocumentTypeModel::fromArray(array('name' => 'Document Type Name', 'description' => 'Document Type description', 'icon_id' => 1, 'defaultview_id' => $this->view->getId(), 'user_id' => $this->user->getId()));
        $this->documentType->save();
        $this->tab = TabModel::fromArray(array('name' => 'TabTest', 'description' => 'TabTest', 'sort_order' => 1, 'document_type_id' => $this->documentType->getId()));
        $this->tab->save();
        $this->property = PropertyModel::fromArray(array('name' => 'DatatypeTest', 'identifier' => 'DatatypeTest', 'description' => 'DatatypeTest', 'required' => false, 'sort_order' => 1, 'tab_id' => $this->tab->getId(), 'datatype_id' => $this->datatype->getId()));
        $this->property->save();
        $mockDatatype = $this->getMockForAbstractClass('Gc\\Datatype\\AbstractDatatype');
        $application = Registry::get('Application');
        $mockDatatype->setRequest($application->getServiceManager()->get('Request'));
        $mockDatatype->setRouter($application->getServiceManager()->get('Router'));
        $mockDatatype->setHelperManager($application->getServiceManager()->get('viewhelpermanager'));
        $mockDatatype->setProperty($this->property);
        $mockDatatype->load($this->datatype, 1);
        $this->object = $this->getMockForAbstractClass('Gc\\Datatype\\AbstractDatatype\\AbstractEditor', array($mockDatatype));
    }