Skip to content

Commit

Permalink
Merge pull request #14 from ezsystems/view_builder_viewtype
Browse files Browse the repository at this point in the history
Made the builder pass the viewType to the SystemInfoView
  • Loading branch information
bdunogier committed Apr 6, 2016
2 parents d5ad189 + 027fa74 commit 1bf51d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Tests/View/SystemInfoViewBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ public function testBuildView()
->method('collect')
->will($this->returnValue($systemInfo));

$view = $builder->buildView(['systemInfoIdentifier' => 'test']);
$view = $builder->buildView(['systemInfoIdentifier' => 'test', 'viewType' => 'test']);
self::assertSame($view->getInfo(), $systemInfo);
self::assertEquals($view->getViewType(), 'test');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion View/SystemInfoViewBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function matches($argument)
public function buildView(array $parameters)
{
$collector = $this->getCollector($parameters['systemInfoIdentifier']);
$view = new SystemInfoView();
$view = new SystemInfoView(null, [], $parameters['viewType']);
$view->setInfo($collector->collect());

$this->viewConfigurator->configure($view);
Expand Down

0 comments on commit 1bf51d3

Please sign in to comment.