Skip to content

Commit

Permalink
XPathConvertor: added covering test
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Apr 17, 2021
1 parent f1fe19a commit 561eec5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/testdox.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6528,6 +6528,7 @@ Single Byte String Manipulation (s9e\TextFormatter\Tests\Configurator\RendererGe
[x] with data set #9

XPath Convertor (s9e\TextFormatter\Tests\Configurator\RendererGenerators\PHP\XPathConvertor)
[x] The constructor accepts an instance of RecursiveParser
[x] PHP features can be toggled before first use with data set #0
[x] PHP features can be toggled before first use with data set #1
[x] PHP features can be toggled before first use with data set #2
Expand Down
18 changes: 18 additions & 0 deletions tests/Configurator/RendererGenerators/PHP/XPathConvertorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@
*/
class XPathConvertorTest extends Test
{
/**
* @testdox The constructor accepts an instance of RecursiveParser
*/
public function testParserConstructor()
{
$mock = $this->getMockBuilder('s9e\\TextFormatter\\Configurator\\RecursiveParser')
->setMethods(['parse'])
->getMock();
$mock->expects($this->once())
->method('parse')
->with('xxx')
->will($this->returnValue(['value' => 'foo']));

$convertor = new XPathConvertor($mock);
$this->assertSame('foo', $convertor->convertXPath('xxx'));
}


/**
* @dataProvider getFeaturesTests
* @testdox PHP features can be toggled before first use
Expand Down

0 comments on commit 561eec5

Please sign in to comment.