Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/Helper/Title.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ public function setRaw($text)
return $this;
}

/**
*
* Gets the currently set title string without HTML tag
*
* @return string
*
*/
public function get()
{
return $this->title;
}

/**
*
* Escapes and appends text to the end of the current <title> string.
Expand Down
13 changes: 13 additions & 0 deletions tests/Helper/TitleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,17 @@ public function testSetIndent()
$expect = ' <title>This and That</title>' . PHP_EOL;
$this->assertSame($expect, $actual);
}

public function testGet()
{
$title = $this->helper;
$this->assertInstanceOf('Aura\Html\Helper\Title', $title);

$title->set('Bar');
$title->prepend('Foo ');

$actual = $title->get();
$expect = 'Foo Bar';
$this->assertSame($expect, $actual);
}
}