Gush\Tests\Helper\TemplateHelperTest::gets_names_for_domain PHP Method

gets_names_for_domain() public method

public gets_names_for_domain ( $templateRegistrations, $domain, $expectedNames, $exception = false )
    public function gets_names_for_domain($templateRegistrations, $domain, $expectedNames, $exception = false)
    {
        foreach ($templateRegistrations as $templateRegistration) {
            $template = $this->prophesize(TemplateInterface::class);
            $template->getName()->willReturn($templateRegistration);
            $this->helper->registerTemplate($template->reveal());
        }
        if ($exception) {
            $this->setExpectedException('InvalidArgumentException', 'Unknown template domain');
        }
        $res = $this->helper->getNamesForDomain($domain);
        $this->assertEquals($expectedNames, $res);
    }