Esempio n. 1
0
 public function visitBoolean($data, Property\BooleanType $property, $path)
 {
     if ($this->validate) {
         parent::visitBoolean($data, $property, $path);
     } else {
         $this->assertRequired($data, $property, $path);
     }
     $data = $data === 'false' ? false : (bool) $data;
     return $this->createSimpleProperty($data, $property);
 }
Esempio n. 2
0
 public function testVisitBooleanNull()
 {
     $visitor = new ValidationVisitor();
     $property = Property::getBoolean('test');
     $this->assertTrue($visitor->visitBoolean(null, $property, ''));
 }