예제 #1
0
 public function testAddCheckbox()
 {
     $builder = new FieldsBuilder('fields');
     $builder->addCheckbox('colors')->addChoice('red')->addChoice('blue')->addChoice('green');
     $expectedConfig = ['fields' => [['name' => 'colors', 'type' => 'checkbox', 'choices' => ['red' => 'red', 'blue' => 'blue', 'green' => 'green']]]];
     $this->assertArraySubset($expectedConfig, $builder->build());
 }