Ejemplo n.º 1
0
 /**
  * Return exported PHP code
  *
  * @param ExportableInterface|StatementInterface|mixed $value
  *
  * @return string
  */
 private function export($value)
 {
     if ($value instanceof ExportableInterface) {
         $value = $this->objectBuilder->build($value);
     }
     return $this->exporter->export($value);
 }
Ejemplo n.º 2
0
 function it_should_be_possible_use_exportable_interface_for_exporting_if_object_builder_is_provided(ExportableInterface $exportable, ObjectBuilderInterface $objectBuilder)
 {
     $objectBuilder->build($exportable)->shouldBeCalled()->willReturn(new Instance('stdClass'));
     $this->beConstructedWith($objectBuilder);
     $this->export($exportable)->shouldReturn('new stdClass()');
 }