Gush\Tests\Template\PullRequest\Create\PullRequestCustomTemplateTest::testRenderTemplate PHP Method

testRenderTemplate() public method

public testRenderTemplate ( array $params, string $expected )
$params array
$expected string
    public function testRenderTemplate(array $params, $expected)
    {
        $table = ['bug_fix' => ['Bug fix?', 'n'], 'new_feature' => ['New feature?', 'n'], 'bc_breaks' => ['BC breaks?', 'n'], 'deprecations' => ['Deprecations?', 'n'], 'tests_pass' => ['Tests pass?', 'n'], 'fixed_tickets' => ['Fixed tickets', ''], 'license' => ['License', 'MIT']];
        $template = $this->getCustomTemplate($table);
        $requirements = $template->getRequirements();
        foreach ($requirements as $key => $requirement) {
            list(, $default) = $requirement;
            if (!isset($params[$key])) {
                $params[$key] = $default;
            }
        }
        $params['description'] = 'This is a description';
        $template->bind($params);
        $res = $template->render();
        $this->assertEquals(self::normalizeWhiteSpace($expected), self::normalizeWhiteSpace($res));
    }