Skip to content

Commit

Permalink
Fix theme provider replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
webeweb committed Sep 28, 2018
1 parent 4925223 commit e92f8e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Manager/AbstractManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function addProvider(ProviderInterface $provider) {
*
* @return ProviderInterface[] Returns the provider.
*/
public function getProviders() {
public function &getProviders() {
return $this->providers;
}

Expand Down
19 changes: 11 additions & 8 deletions Tests/Manager/ThemeManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,14 @@ public function testAddGlobal() {
*/
public function testSetApplicationThemeProvider() {

// Set the Application theme provider mock.
// Set a Application theme provider mock.
$provider = $this->getMockBuilder(ApplicationThemeProviderInterface::class)->getMock();

$obj = new ThemeManager($this->twigEnvironment);

$obj->setApplicationThemeProvider($this->getMockBuilder(ApplicationThemeProviderInterface::class)->getMock());
$this->assertNotSame($provider, $obj->getApplicationThemeProvider());

$obj->setApplicationThemeProvider($provider);
$this->assertSame($provider, $obj->getApplicationThemeProvider());
}
Expand All @@ -139,7 +142,7 @@ public function testSetApplicationThemeProvider() {
*/
public function testSetBreadcrumbsThemeProvider() {

// Set the Breadcrumbs theme provider mock.
// Set a Breadcrumbs theme provider mock.
$provider = $this->getMockBuilder(BreadcrumbsThemeProviderInterface::class)->getMock();

$obj = new ThemeManager($this->twigEnvironment);
Expand All @@ -156,7 +159,7 @@ public function testSetBreadcrumbsThemeProvider() {
*/
public function testSetFooterThemeProvider() {

// Set the mocks.
// Set a Footer theme provider mock.
$provider = $this->getMockBuilder(FooterThemeProviderInterface::class)->getMock();

$obj = new ThemeManager($this->twigEnvironment);
Expand All @@ -173,7 +176,7 @@ public function testSetFooterThemeProvider() {
*/
public function testSetHookDropDownThemeProvider() {

// Set the mocks.
// Set a Hook drop down theme provider mock.
$provider = $this->getMockBuilder(HookDropDownThemeProviderInterface::class)->getMock();

$obj = new ThemeManager($this->twigEnvironment);
Expand All @@ -190,7 +193,7 @@ public function testSetHookDropDownThemeProvider() {
*/
public function testSetNavigationThemeProvider() {

// Set the mocks.
// Set a Navigation theme provider mock.
$provider = $this->getMockBuilder(NavigationThemeProviderInterface::class)->getMock();

$obj = new ThemeManager($this->twigEnvironment);
Expand All @@ -207,7 +210,7 @@ public function testSetNavigationThemeProvider() {
*/
public function testSetNotificationsDropDownThemeProvider() {

// Set the mocks.
// Set a Notifications drop down theme provider mock.
$provider = $this->getMockBuilder(NotificationsDropDownThemeProviderInterface::class)->getMock();

$obj = new ThemeManager($this->twigEnvironment);
Expand All @@ -224,7 +227,7 @@ public function testSetNotificationsDropDownThemeProvider() {
*/
public function testSetSearchThemeProvider() {

// Set the mocks.
// Set a Search theme provider mock.
$provider = $this->getMockBuilder(SearchThemeProviderInterface::class)->getMock();

$obj = new ThemeManager($this->twigEnvironment);
Expand All @@ -241,7 +244,7 @@ public function testSetSearchThemeProvider() {
*/
public function testSetTasksDropDownThemeProvider() {

// Set the mocks.
// Set a Tasks drop down theme provider mock.
$provider = $this->getMockBuilder(TasksDropDownThemeProviderInterface::class)->getMock();

$obj = new ThemeManager($this->twigEnvironment);
Expand Down

0 comments on commit e92f8e0

Please sign in to comment.