/** * @param Node $node * @return array */ private function attributes(Node $node) { if ($node->isArray()) { $attributes = ['name' => $node->getSanitizedName(), 'type' => 'ns:' . $node->getNameForArray()]; } elseif ($node->isObject()) { $attributes = ['name' => $node->getSanitizedName(), 'element' => 'ns:' . $node->getNameForObject()]; } else { $attributes = ['name' => $node->getSanitizedName(), 'type' => 'xsd:' . $node->getType()]; } return $attributes; }
/** * @test */ public function shouldGetNameForArray() { //given $node = new Node('int', '$age', true); //when $name = $node->getNameForArray(); //then $this->assertEquals('ArrayOfAge', $name); }