Inheritance: extends Gc\Datatype\AbstractDatatype
Exemple #1
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     $this->datatype = DatatypeModel::fromArray(array('name' => 'MixedTest', 'prevalue_value' => 'a:1:{s:9:"datatypes";a:1:{i:0;a:3:{s:4:"name";' . 's:10:"Textstring";s:5:"label";s:4:"Test";s:6:"config";' . 'a:1:{s:6:"length";s:0:"";}}}}', 'model' => 'Mixed'));
     $this->datatype->save();
     $datatype = new Datatype();
     $application = Registry::get('Application');
     $datatype->setRequest($application->getServiceManager()->get('Request'));
     $datatype->setRouter($application->getServiceManager()->get('Router'));
     $datatype->setHelperManager($application->getServiceManager()->get('viewhelpermanager'));
     $datatype->setDatatypesList($application->getServiceManager()->get('DatatypesList'));
     $datatype->load($this->datatype);
     $this->object = $datatype->getPrevalueEditor();
 }
Exemple #2
0
 /**
  * Test
  *
  * @return void
  */
 public function testGetPrevalueEditor()
 {
     $this->assertInstanceOf('Datatypes\\Mixed\\PrevalueEditor', $this->object->getPrevalueEditor());
 }
Exemple #3
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     $this->view = ViewModel::fromArray(array('name' => 'View Name', 'identifier' => 'View identifier', 'description' => 'View Description', 'content' => 'View Content'));
     $this->view->save();
     $this->layout = LayoutModel::fromArray(array('name' => 'Layout Name', 'identifier' => 'Layout identifier', 'description' => 'Layout Description', 'content' => 'Layout Content'));
     $this->layout->save();
     $this->user = UserModel::fromArray(array('lastname' => 'User test', 'firstname' => 'User test', 'email' => '*****@*****.**', '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->datatype = DatatypeModel::fromArray(array('name' => 'MixedTest', 'prevalue_value' => 'a:1:{s:9:"datatypes";a:1:{i:0;a:3:{s:4:"name";' . 's:10:"Textstring";s:5:"label";s:4:"Test";s:6:"config";' . 'a:1:{s:6:"length";s:0:"";}}}}', 'model' => 'Mixed'));
     $this->datatype->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();
     $datatype = new Datatype();
     $application = Registry::get('Application');
     $datatype->setRequest($application->getServiceManager()->get('Request'));
     $datatype->setRouter($application->getServiceManager()->get('Router'));
     $datatype->setHelperManager($application->getServiceManager()->get('viewhelpermanager'));
     $datatype->load($this->datatype);
     $this->object = $datatype->getEditor($this->property);
 }