예제 #1
0
 public function testBuildViewWithoutScope()
 {
     $this->nameStrategy->expects($this->never())->method('buildGridFullName');
     $view = $this->getBlockView(new DatagridType($this->nameStrategy), ['grid_name' => 'test-grid', 'grid_parameters' => ['foo' => 'bar']]);
     $this->assertEquals('test-grid', $view->vars['grid_name']);
     $this->assertEquals('test-grid', $view->vars['grid_full_name']);
     $this->assertFalse(isset($view->vars['grid_scope']));
     $this->assertEquals(['foo' => 'bar', 'enableFullScreenLayout' => true], $view->vars['grid_parameters']);
 }
예제 #2
0
 public function testBuildGridFullNameWorks()
 {
     $expectedFullName = 'test-grid:test-scope';
     $gridName = 'test-grid';
     $gridScope = 'test-scope';
     $this->nameStrategy->expects($this->once())->method('buildGridFullName')->will($this->returnValue($expectedFullName));
     $this->assertEquals($expectedFullName, $this->twigExtension->buildGridFullName($gridName, $gridScope));
 }