RomaricDrigon\MetaYaml\XsdNodeGenerator\XsdPartialNodeGenerator::build PHP Method

build() public method

public build ( $name, $node, XMLWriter &$writer, $under_root )
$writer XMLWriter
    public function build($name, $node, \XMLWriter &$writer, $under_root)
    {
        // here partial is purely a "shortcut"
        // partial node can not be required; partials yes
        // return for test code coverage...
        return $this->xsd_generator->buildPartial($node[$this->xsd_generator->getFullName('partial')], $writer, $under_root);
    }

Usage Example

 public function testBase()
 {
     $this->if($xsd_generator = new XsdGenerator())->and($object = new testedClass($xsd_generator))->then->object($object)->isInstanceOf('RomaricDrigon\\MetaYaml\\XsdNodeGenerator\\XsdPartialNodeGenerator')->exception(function () use($object) {
         $object->build('test', array('_partial' => 'nom_partial'), new \XMLWriter(), false);
     })->hasMessage("You're using a partial but partial 'nom_partial' is not defined in your schema");
 }
XsdPartialNodeGenerator