Ejemplo n.º 1
0
 public function testAddSelect()
 {
     $builder = new FieldsBuilder('fields');
     $builder->addSelect('colors', ['choices' => [['yellow' => 'Yellow']]])->addChoices(['red' => 'Rojo'], 'blue')->addChoice('green');
     $expectedConfig = ['fields' => [['name' => 'colors', 'type' => 'select', 'choices' => ['yellow' => 'Yellow', 'red' => 'Rojo', 'blue' => 'blue', 'green' => 'green']]]];
     $this->assertArraySubset($expectedConfig, $builder->build());
 }