Exemplo n.º 1
0
 public function testVisitStringNull()
 {
     $visitor = new ValidationVisitor();
     $property = Property::getString('test');
     $this->assertTrue($visitor->visitString(null, $property, ''));
 }
Exemplo n.º 2
0
 public function visitString($data, Property\StringType $property, $path)
 {
     if ($this->validate) {
         parent::visitString($data, $property, $path);
     } else {
         $this->assertRequired($data, $property, $path);
     }
     // data from an blob column gets returned as resource
     if (is_resource($data)) {
         $data = base64_encode(stream_get_contents($data, -1, 0));
     } else {
         $data = (string) $data;
     }
     return $this->createSimpleProperty($data, $property);
 }