public function testNgRestConfigAppendFieldOption()
 {
     $configData = $this->getConfig();
     $ngRest = new Config(['apiEndpoint' => 'api-admin-test', 'primaryKey' => 'id']);
     $ngRest->setConfig($configData);
     $ngRest->appendFieldOption('list_var_1', 'i18n', true);
     $field = $ngRest->getField('list', 'list_var_1');
     $this->assertEquals(true, $field['i18n']);
     $field = $ngRest->getField('list', 'list_var_2');
     $this->assertEquals(false, $field['i18n']);
 }
Esempio n. 2
0
 public function testAddFieldIfExists()
 {
     $cfg = new Config(['apiEndpoint' => 'rest-url', 'primaryKey' => 'id']);
     $this->assertEquals(true, $cfg->addField('list', 'foo'));
     $this->assertEquals(false, $cfg->addField('list', 'foo'));
 }