Definition at line 10 of file WordsFinderTest.php.
◆ constructorExceptionDataProvider()
constructorExceptionDataProvider |
( |
| ) |
|
Definition at line 23 of file WordsFinderTest.php.
25 $fixturePath =
__DIR__ .
'/_files/';
27 'non-existing config file' => [$fixturePath .
'non-existing.xml', $fixturePath],
28 'non-existing base dir' => [$fixturePath .
'config.xml', $fixturePath .
'non-existing-dir'],
29 'broken config' => [$fixturePath .
'broken_config.xml', $fixturePath],
30 'empty words config' => [$fixturePath .
'empty_words_config.xml', $fixturePath],
31 'empty whitelisted path' => [$fixturePath .
'empty_whitelisted_path.xml', $fixturePath]
defined('TESTS_BP')||define('TESTS_BP' __DIR__
◆ findWordsDataProvider()
findWordsDataProvider |
( |
| ) |
|
- Returns
- array
Definition at line 55 of file WordsFinderTest.php.
57 $mainConfig =
__DIR__ .
'/_files/config.xml';
58 $additionalConfig =
__DIR__ .
'/_files/config_additional.xml';
59 $basePath =
__DIR__ .
'/_files/words_finder/';
61 'usual file' => [$mainConfig, $basePath .
'buffy.php', [
'demon',
'vampire']],
62 'whitelisted file' => [$mainConfig, $basePath .
'twilight/eclipse.php', []],
63 'partially whitelisted file' => [$mainConfig, $basePath .
'twilight/newmoon.php', [
'demon']],
64 'filename with bad word' => [
66 $basePath .
'interview_with_the_vampire.php',
69 'binary file, having name with bad word' => [
71 $basePath .
'interview_with_the_vampire.zip',
74 'words in multiple configs' => [
75 [$mainConfig, $additionalConfig],
76 $basePath .
'buffy.php',
77 [
'demon',
'vampire',
'darkness'],
79 'whitelisted paths in multiple configs' => [
80 [$mainConfig, $additionalConfig],
81 $basePath .
'twilight/newmoon.php',
84 'config must be whitelisted automatically' => [
85 $basePath .
'self_tested_config.xml',
86 $basePath .
'self_tested_config.xml',
defined('TESTS_BP')||define('TESTS_BP' __DIR__
◆ testConstructorException()
testConstructorException |
( |
|
$configFile, |
|
|
|
$baseDir |
|
) |
| |
- Parameters
-
string | $configFile | |
string | $baseDir | @expectedException \Magento\TestFramework\Inspection\Exception @dataProvider constructorExceptionDataProvider |
Definition at line 18 of file WordsFinderTest.php.
20 new \Magento\TestFramework\Inspection\WordsFinder($configFile,
$baseDir,
new ComponentRegistrar());
◆ testFindWords()
testFindWords |
( |
|
$configFiles, |
|
|
|
$file, |
|
|
|
$expected |
|
) |
| |
- Parameters
-
string | array | $configFiles | |
string | $file | |
array | $expected | @dataProvider findWordsDataProvider |
Definition at line 41 of file WordsFinderTest.php.
43 $wordsFinder = new \Magento\TestFramework\Inspection\WordsFinder(
45 __DIR__ .
'/_files/words_finder',
46 new ComponentRegistrar()
48 $actual = $wordsFinder->findWords($file);
49 $this->assertEquals($expected, $actual);
defined('TESTS_BP')||define('TESTS_BP' __DIR__
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/dev/tests/static/framework/tests/unit/testsuite/Magento/TestFramework/Inspection/WordsFinderTest.php