Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit e6f2542

Browse files
committed
Promote ViewManager::getView() to public visibility
Modules such as zf-rpc were calling the method, regardless of what type `ViewManager` is, making it de facto part of the public interface. This patch promotes the visibility so that it can be called this way.
1 parent 4b5b18d commit e6f2542

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/View/ViewManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function onBootstrap($event)
102102
*
103103
* @return View
104104
*/
105-
private function getView()
105+
public function getView()
106106
{
107107
if ($this->view) {
108108
return $this->view;

test/View/ViewManagerTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,4 +447,18 @@ public function testWillRegisterViewStrategiesFromConfiguration($config, $strate
447447
$manager = new ViewManager();
448448
$this->assertNull($manager->onBootstrap($event->reveal()));
449449
}
450+
451+
/**
452+
* @group 14
453+
*/
454+
public function testViewAccessorIsPublic()
455+
{
456+
$view = $this->prophesize(View::class)->reveal();
457+
$viewmanager = new ViewManager();
458+
$r = new ReflectionProperty($viewmanager, 'view');
459+
$r->setAccessible(true);
460+
$r->setValue($viewmanager, $view);
461+
462+
$this->assertSame($view, $viewmanager->getView());
463+
}
450464
}

0 commit comments

Comments
 (0)