tick() public method

Ticks a checkbox.
public tick ( )
Ejemplo n.º 1
0
 public function testTick()
 {
     $node = $this->createSelectNode(array('foo' => false, 'bar' => false));
     $field = new ChoiceFormField($node);
     try {
         $field->tick();
         $this->fail('->tick() throws a \\LogicException for select boxes');
     } catch (\LogicException $e) {
         $this->assertTrue(true, '->tick() throws a \\LogicException for select boxes');
     }
     $node = $this->createNode('input', '', array('type' => 'checkbox', 'name' => 'name'));
     $field = new ChoiceFormField($node);
     $field->tick();
     $this->assertEquals(1, $field->getValue(), '->tick() ticks checkboxes');
 }