[Templating] fixed phpdoc a test
This commit is contained in:
parent
6c4801945e
commit
20c5db2197
@ -34,7 +34,9 @@ class TemplateReference implements TemplateReferenceInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* Returns the template signature
|
||||
*
|
||||
* @return string A UID for the template
|
||||
*/
|
||||
public function getSignature()
|
||||
{
|
||||
@ -42,7 +44,14 @@ class TemplateReference implements TemplateReferenceInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* Sets a template parameter.
|
||||
*
|
||||
* @param string $name The parameter name
|
||||
* @param string $value The parameter value
|
||||
*
|
||||
* @return TemplateReferenceInterface The TemplateReferenceInterface instance
|
||||
*
|
||||
* @throws \InvalidArgumentException if the parameter is not defined
|
||||
*/
|
||||
public function set($name, $value)
|
||||
{
|
||||
@ -56,7 +65,13 @@ class TemplateReference implements TemplateReferenceInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* Gets a template parameter.
|
||||
*
|
||||
* @param string $name The parameter name
|
||||
*
|
||||
* @return string The parameter value
|
||||
*
|
||||
* @throws \InvalidArgumentException if the parameter is not defined
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
@ -68,7 +83,9 @@ class TemplateReference implements TemplateReferenceInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* Gets the template parameters.
|
||||
*
|
||||
* @return array An array of parameters
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
@ -76,7 +93,11 @@ class TemplateReference implements TemplateReferenceInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* Returns the path to the template.
|
||||
*
|
||||
* By default, it just returns the template name.
|
||||
*
|
||||
* @return string A path to the template or a resource
|
||||
*/
|
||||
public function getPath()
|
||||
{
|
||||
@ -84,7 +105,9 @@ class TemplateReference implements TemplateReferenceInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* Returns the template name
|
||||
*
|
||||
* @return string The template name
|
||||
*/
|
||||
public function getLogicalName()
|
||||
{
|
||||
|
@ -31,20 +31,20 @@ class TemplateNameParserTest extends \PHPUnit_Framework_TestCase
|
||||
/**
|
||||
* @dataProvider getLogicalNameToTemplateProvider
|
||||
*/
|
||||
public function testParse($name, $ref, $refname)
|
||||
public function testParse($name, $ref)
|
||||
{
|
||||
$template = $this->parser->parse($name);
|
||||
|
||||
$this->assertEquals($template->getSignature(), $ref->getSignature());
|
||||
$this->assertEquals($template->getLogicalName(), $refname);
|
||||
$this->assertEquals($template->getLogicalName(), $name);
|
||||
}
|
||||
|
||||
public function getLogicalNameToTemplateProvider()
|
||||
{
|
||||
return array(
|
||||
array('/path/to/section/name.engine', new TemplateReference('/path/to/section/name.engine', 'engine'), '/path/to/section/name.engine'),
|
||||
array('name.engine', new TemplateReference('name.engine', 'engine'), 'name.engine'),
|
||||
array('name', new TemplateReference('name'), 'name'),
|
||||
array('/path/to/section/name.engine', new TemplateReference('/path/to/section/name.engine', 'engine')),
|
||||
array('name.engine', new TemplateReference('name.engine', 'engine')),
|
||||
array('name', new TemplateReference('name')),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user