function it_returns_an_iterator_type_for_iterator_operations(Operation $operation) { $operation->getIteratorName()->willReturn('BlahIterator'); $this->description->getOperation('IteratorOperation')->shouldBeCalled(); $this->description->getOperation('IteratorOperation')->willReturn($operation); $class = new \ReflectionClass(__NAMESPACE__ . '\\FixturesClass'); $method = $class->getMethod('iteratorOperation'); $this->beConstructedWith($this->stream, $method, $this->description); $string = <<<'EOT' .. method:: iteratorOperation(array $options = []) :param array $options: See Additional Parameters table :return: a resource iterator :rtype: OpenStack\Common\Iterator\ResourceIterator :raises CommandException: If a HTTP or network connection error occurs EOT; $this->stream->write($string)->shouldBeCalled(); $this->write(); }
function it_writes_additional_properties(Operation $operation, Parameter $param1, Parameter $param2, Parameter $param3) { $param1->getName()->willReturn('Foo'); $param1->getType()->willReturn('string'); $param1->getDescription()->willReturn('This is a desc of Foo'); $param1->getStatic()->willReturn(false); $param1->getEnum()->willReturn(false); $param1->getRequired()->willReturn(false); $param2->getName()->willReturn('Bar'); $param2->getType()->willReturn('string'); $param2->getDescription()->willReturn('This is a desc of Bar'); $param2->getStatic()->willReturn(false); $param2->getEnum()->willReturn(false); $param2->getRequired()->willReturn(false); $param3->getName()->willReturn('Baz'); $param3->getType()->willReturn('string'); $param3->getDescription()->willReturn('This is a desc of Baz'); $param3->getStatic()->willReturn(true); $param3->getEnum()->willReturn(false); $param3->getRequired()->willReturn(false); $operation->getParams()->willReturn([$param1, $param2, $param3]); $this->description->getOperation('BarOperation')->willReturn($operation); $string = <<<EOT Additional Parameters ~~~~~~~~~~~~~~~~~~~~~ +--------+----------+------------+-------------------------+ | Name | Type | Required | Description | +========+==========+============+=========================+ | Foo | string | No | This is a desc of Foo | +--------+----------+------------+-------------------------+ | Bar | string | No | This is a desc of Bar | +--------+----------+------------+-------------------------+ EOT; $this->stream->write($string)->shouldBeCalled(); $this->write(); }