Skip to content

Commit

Permalink
Add test case for Url handler without request
Browse files Browse the repository at this point in the history
  • Loading branch information
emodric committed Mar 8, 2018
1 parent 0a3267b commit fcaad26
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/Handler/Literal/UrlTest.php
Expand Up @@ -72,4 +72,32 @@ public function validResultProvider()
array('', 'https://domain.com/'),
);
}

/**
* @dataProvider validResultProviderWithoutRequest
*
* @param string $input
* @param string $output
*/
public function testGettingTagsWithValidResultAndWithoutRequest($input, $output)
{
$result = $this->url->getMetaTags('some_tag', array($input));

$this->assertInternalType('array', $result);
$this->assertInstanceOf(Item::class, $result[0]);
$this->assertEquals('some_tag', $result[0]->getTagName());
$this->assertEquals($output, $result[0]->getTagValue());
}

public function validResultProviderWithoutRequest()
{
return array(
array('https://other.domain.com/some/path', 'https://other.domain.com/some/path'),
array('http://other.domain.com/some/path', 'http://other.domain.com/some/path'),
array('/some/path', '/some/path'),
array('some/path', 'some/path'),
array('/', '/'),
array('', ''),
);
}
}

0 comments on commit fcaad26

Please sign in to comment.