translator = $this->createMock('ResponsiveMenu\Translation\Translator'); $this->component = new ResponsiveMenu\ViewModels\Components\Menu\AdditionalContent($this->translator); } public function testRender() { $collection = new ResponsiveMenu\Collections\OptionsCollection; $collection->add(new ResponsiveMenu\Models\Option('menu_additional_content', 'b')); $this->translator->method('translate')->willReturn('b'); $this->translator->method('allowShortcode')->willReturn('b'); $this->assertEquals('
', $this->component->render($collection)); } public function testRenderEmpty() { $collection = new ResponsiveMenu\Collections\OptionsCollection; $collection->add(new ResponsiveMenu\Models\Option('menu_additional_content', '')); $this->translator->method('translate')->willReturn(''); $this->translator->method('allowShortcode')->willReturn(''); $this->assertNull($this->component->render($collection)); } }