2019-12-05 21:25:58 +01:00
|
|
|
<?php namespace Todaymade\Daux;
|
2016-07-04 20:33:44 +02:00
|
|
|
|
2017-11-11 07:22:27 +01:00
|
|
|
use PHPUnit\Framework\TestCase;
|
2019-12-05 21:25:58 +01:00
|
|
|
use Todaymade\Daux\ConfigBuilder;
|
2017-11-11 07:22:27 +01:00
|
|
|
|
|
|
|
class DauxHelperTest extends TestCase
|
2016-07-27 21:32:51 +02:00
|
|
|
{
|
|
|
|
public function providerGetFilenames()
|
|
|
|
{
|
2016-07-04 20:33:44 +02:00
|
|
|
return [
|
2016-07-27 21:32:51 +02:00
|
|
|
[['Page.html', 'Page'], 'Page.html'],
|
|
|
|
[['Page.html', 'Page'], 'Page.md'],
|
|
|
|
[['Page.html', 'Page'], 'Page'],
|
|
|
|
[['Code_Highlighting.html', 'Code_Highlighting'], '05_Code_Highlighting.md'],
|
2016-07-04 20:33:44 +02:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providerGetFilenames
|
|
|
|
*/
|
2016-07-27 21:32:51 +02:00
|
|
|
public function testGetFilenames($expected, $node)
|
|
|
|
{
|
2019-12-05 21:25:58 +01:00
|
|
|
$config = ConfigBuilder::withMode()
|
|
|
|
->withValidContentExtensions(['md'])
|
|
|
|
->build();
|
2016-07-04 20:33:44 +02:00
|
|
|
|
|
|
|
$this->assertEquals($expected, DauxHelper::getFilenames($config, $node));
|
|
|
|
}
|
|
|
|
}
|