Ejemplo n.º 1
0
 /**
  * @param FunctionalTester $I
  *
  * @actor FunctionalTester
  *
  * @return void
  */
 public function addTag(FunctionalTester $I)
 {
     $I->am('Admin User');
     $I->wantTo('add new tag');
     $tag = new Tag();
     $group = $tag->getGroups()->random(1);
     $data = ['name' => 'tag1', 'group' => $group->id, 'bgcolor' => 'red'];
     $I->amLoggedAs($I->createUser(1, 4));
     $I->amOnAction('Administration\\TagsController@getNew');
     $I->submitForm('form', $data);
     $I->seeCurrentActionIs('Administration\\TagsController@getIndex');
     $I->seeRecord($tag->getTable(), $data);
 }
Ejemplo n.º 2
0
 /**
  * @return array
  */
 public function fields()
 {
     $tag = new Model\Tag();
     $fields = ['name' => ['type' => 'text', 'label' => 'name'], 'group' => ['type' => 'select', 'label' => 'group', 'options' => [0 => ''] + $tag->getGroups()->lists('name', 'id')->all()], 'bgcolor' => ['type' => 'color', 'label' => 'bgcolor']];
     return $fields;
 }