assertInstanceOf(\Renderer::class, $service->getRenderer()); } public function testSetHasView() { $service = new ProxyMockForRendererTrait(); $service->setView('fixture'); $this->assertTrue($service->hasView()); } public function testSetData() { $service = new ProxyMockForRendererTrait(); $service->setData('fixture-key', 'fixture-value'); $property = new \ReflectionProperty(\Renderer::class, 'variables'); $property->setAccessible(true); $variables = $property->getValue($service->getRenderer()); $this->assertCount(1, $variables); $this->assertArrayHasKey('fixture-key', $variables); $this->assertEquals('fixture-value', $variables['fixture-key']); } public function testNotViewIfNoRenderer() { $service = new ProxyMockForRendererTrait(); $this->assertFalse($service->hasView()); } } class ProxyMockForRendererTrait { use RendererTrait; }