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

Commit

Permalink
Added CHANGELOG for #163
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Jun 30, 2016
1 parent df63e7e commit bdf5b04
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 7 deletions.
32 changes: 31 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,37 @@ All notable changes to this project will be documented in this file, in reverse

### Added

- Nothing.
- [#163](https://github.com/zendframework/zend-mvc/pull/163) adds support to the
`AcceptableViewModelSelector` plugin for controller maps in the `view_manager`
configuration in the format:

```php
[
'ControllerClassName' => 'view/name',
]
```

This fixes an issue observed when running with Apigility.

- [#163](https://github.com/zendframework/zend-mvc/pull/163) adds support to the
`InjectTemplateListener` for specifying whether or not to prefer the
controller matched during routing via routing configuration:

```php
'route-name' => [
/* ... */
'options' => [
/* ... */
'defaults' => [
/* ... */
'prefer_route_match_controller' => true,
],
],
],
```

This allows actions that might otherwise skip injection of the template
to force the injection.

### Deprecated

Expand Down
13 changes: 7 additions & 6 deletions test/View/InjectTemplateListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Zend\Router\RouteMatch;
use Zend\Mvc\View\Http\InjectTemplateListener;
use Zend\View\Model\ViewModel;
use ZendTest\Mvc\Controller\TestAsset\SampleController;

class InjectTemplateListenerTest extends TestCase
{
Expand Down Expand Up @@ -108,7 +109,7 @@ public function testBypassesTemplateInjectionIfResultViewModelAlreadyHasATemplat
public function testMapsSubNamespaceToSubDirectory()
{
$myViewModel = new ViewModel();
$myController = new \ZendTest\Mvc\Controller\TestAsset\SampleController();
$myController = new SampleController();
$this->event->setTarget($myController);
$this->event->setResult($myViewModel);

Expand Down Expand Up @@ -158,7 +159,7 @@ public function testMapsSubNamespaceToSubDirectoryWithControllerFromEventTarget(
$moduleRouteListener->onRoute($this->event);

$myViewModel = new ViewModel();
$myController = new \ZendTest\Mvc\Controller\TestAsset\SampleController();
$myController = new SampleController();

$this->event->setTarget($myController);
$this->event->setResult($myViewModel);
Expand All @@ -183,7 +184,7 @@ public function testMapsSubNamespaceToSubDirectoryWithControllerFromEventTargetS
$template1 = $myViewModel->getTemplate();

$myViewModel = new ViewModel();
$myController = new \ZendTest\Mvc\Controller\TestAsset\SampleController();
$myController = new SampleController();

$this->event->setTarget($myController);
$this->event->setResult($myViewModel);
Expand All @@ -204,7 +205,7 @@ public function testControllerMatchedByMapIsInflected()

$this->listener->setControllerMap(['ZendTest' => true]);
$myViewModel = new ViewModel();
$myController = new \ZendTest\Mvc\Controller\TestAsset\SampleController();
$myController = new SampleController();
$this->event->setTarget($myController);
$this->event->setResult($myViewModel);

Expand Down Expand Up @@ -332,7 +333,7 @@ public function testPrefersRouteMatchController()
$this->listener->setPreferRouteMatchController(true);
$this->routeMatch->setParam('controller', 'Some\Other\Service\Namespace\Controller\Sample');
$myViewModel = new ViewModel();
$myController = new \ZendTest\Mvc\Controller\TestAsset\SampleController();
$myController = new SampleController();

$this->event->setTarget($myController);
$this->event->setResult($myViewModel);
Expand All @@ -356,7 +357,7 @@ public function testPrefersRouteMatchControllerWithRouteMatchAndControllerMap()
$this->listener->setControllerMap($controllerMap);

$myViewModel = new ViewModel();
$myController = new \ZendTest\Mvc\Controller\TestAsset\SampleController();
$myController = new SampleController();

$this->event->setTarget($myController);
$this->event->setResult($myViewModel);
Expand Down

0 comments on commit bdf5b04

Please sign in to comment.