Exemple #1
0
 public function getFieldsInfo()
 {
     $initialFields = ['id' => '\\Extasy\\Model\\Columns\\Index', 'login' => ['class' => '\\Extasy\\Users\\Columns\\Login', 'parse_field' => 'getValue'], 'password' => ['class' => '\\Extasy\\Users\\Columns\\Password', 'hash' => $this->configurationRepository->read()->securityHash, 'parse_field' => 'getValue'], 'time_access' => ['class' => '\\Extasy\\Users\\Columns\\TimeAccess', 'parse_field' => 'getValue'], 'registered' => ['class' => '\\Extasy\\Model\\Columns\\Datetime', 'parse_field' => 'getValue'], 'confirmation_code' => ['class' => '\\Extasy\\Users\\Columns\\ConfirmationCode'], 'email_confirmation_code' => ['class' => '\\Extasy\\Users\\Columns\\ConfirmationCode'], 'email' => ['class' => '\\Extasy\\Users\\Columns\\Email', 'parse_field' => 'getValue'], 'new_email' => '\\Extasy\\Model\\Columns\\Input'];
     $fields = $this->configurationRepository->read()->fields;
     $fields = array_merge($initialFields, $fields);
     return ['fields' => $fields];
 }
 public function testWriteAndGet()
 {
     $fixture = new Configuration();
     $fixture->fields = ['name' => '\\Extasy\\Model\\Columns\\Input', 'surname' => '\\Extasy\\Model\\Columns\\Input'];
     $this->configurationRepository->write($fixture);
     $this->assertEquals($fixture, $this->configurationRepository->read());
     $anotherFixture = new Configuration();
     $anotherFixture->fields = ['name2' => '\\Extasy\\Model\\Columns\\Input', 'surname2' => '\\Extasy\\Model\\Columns\\Input'];
     $this->configurationRepository->write($anotherFixture);
     $this->assertEquals($anotherFixture, $this->configurationRepository->read());
 }