name: GitignoreTest class_comment: "# * @author Michael Vo\u0159\xED\u0161ek " dependencies: - name: TestCase type: class source: PHPUnit\Framework\TestCase - name: Gitignore type: class source: Symfony\Component\Finder\Gitignore properties: [] methods: - name: testToRegex visibility: public parameters: - name: gitignoreLines - name: matchingCases - name: nonMatchingCases comment: "# * @author Michael Vo\u0159\xED\u0161ek \n# */\n\ # class GitignoreTest extends TestCase\n# {\n# /**\n# * @dataProvider provider\n\ # * @dataProvider providerExtended" - name: provider visibility: public parameters: [] comment: null - name: testToRegexMatchingNegatedPatterns visibility: public parameters: - name: gitignoreLines - name: matchingCases - name: nonMatchingCases comment: "# ', 'p/**/', 'x**y'],\n# ['a', 'a/b', 'a/b/c', 'm/', 'o/', 'p/', 'xy',\ \ 'xuy', 'x/y', 'x/u/y', 'xu/y', 'x/uy', 'xu/uy'],\n# ['aa', 'm', 'b/m', 'b/m/',\ \ 'o', 'b/o', 'b/o/', 'p', 'b/p', 'b/p/'],\n# ],\n# [\n# ['a', '!x'],\n# ['a',\ \ 'a/b', 'a/b/c', 'b/a', 'b/c/a'],\n# ['x', 'aa', 'm.txt', '.txt', 'aa/b', 'b/aa'],\n\ # ],\n# [\n# ['a', '!a/', 'b', '!b/b'],\n# ['a', 'a/x', 'x/a', 'x/a/x', 'b', 'b'],\n\ # ['a/', 'x/a/', 'bb', 'b/b', 'bb'],\n# ],\n# [\n# ['[a-c]', 'x[C-E][][o]', 'g-h'],\n\ # ['a', 'b', 'c', 'xDo', 'g-h'],\n# ['A', 'xdo', 'u', 'g', 'h'],\n# ],\n# [\n\ # ['a?', '*/??b?'],\n# ['ax', 'x/xxbx'],\n# ['a', 'axy', 'xxax', 'x/xxax', 'x/y/xxax'],\n\ # ],\n# [\n# [' ', ' \\ ', ' \\ ', '/a ', '/b/c \\ '],\n# [' ', ' ', 'x/\ \ ', 'x/ ', 'a', 'a/x', 'b/c '],\n# [' ', ' ', 'x/ ', 'x/ ', 'a ', 'b/c\ \ '],\n# ],\n# [\n# ['#', ' #', '/ #', ' #', '/ #', ' \\ #', ' \\ #',\ \ 'a #', 'a #', 'a \\ #', 'a \\ #'],\n# [' ', ' ', 'a', 'a ', 'a \ \ '],\n# [' ', ' ', 'a ', 'a '],\n# ],\n# [\n# [\"\\t\", \"\\t\\\\\\t\", \"\ \ \\t\\\\\\t \", \"\\t#\", \"a\\t#\", \"a\\t\\t#\", \"a \\t#\", \"a\\t\\t\\\\\\\ t#\", \"a \\t\\t\\\\\\t\\t#\"],\n# [\"\\t\\t\", \" \\t\\t\", 'a', \"a\\t\\t\\\ t\", \"a \\t\\t\\t\"],\n# [\"\\t\", \"\\t\\t \", \" \\t\\t \", \"a\\t\", 'a ',\ \ \"a \\t\", \"a\\t\\t\"],\n# ],\n# [\n# [' a', 'b ', '\\ ', 'c\\ '],\n# [' a',\ \ 'b', ' ', 'c '],\n# ['a', 'b ', 'c'],\n# ],\n# [\n# ['#a', '\\#b', '\\#/'],\n\ # ['#b', '#/'],\n# ['#a', 'a', 'b'],\n# ],\n# [\n# ['*', '!!', '!!*x', '\\!!b'],\n\ # ['a', '!!', '!!b'],\n# ['!', '!x', '!xx'],\n# ],\n# [\n# [\n# '*',\n# '!/bin',\n\ # '!/bin/bash',\n# ],\n# ['bin/cat', 'abc/bin/cat'],\n# ['bin/bash'],\n# ],\n\ # [\n# ['fi#le.txt'],\n# [],\n# ['#file.txt'],\n# ],\n# [\n# [\n# '/bin/',\n#\ \ '/usr/local/',\n# '!/bin/bash',\n# '!/usr/local/bin/bash',\n# ],\n# ['bin/cat'],\n\ # ['bin/bash'],\n# ],\n# [\n# ['*.py[co]'],\n# ['file.pyc', 'file.pyc'],\n# ['filexpyc',\ \ 'file.pycx', 'file.py'],\n# ],\n# [\n# ['dir1/**/dir2/'],\n# ['dir1/dir2/',\ \ 'dir1/dirA/dir2/', 'dir1/dirA/dirB/dir2/'],\n# ['dir1dir2/', 'dir1xdir2/', 'dir1/xdir2/',\ \ 'dir1x/dir2/'],\n# ],\n# [\n# ['dir1/*/dir2/'],\n# ['dir1/dirA/dir2/'],\n# ['dir1/dirA/dirB/dir2/'],\n\ # ],\n# [\n# ['/*.php'],\n# ['file.php'],\n# ['app/file.php'],\n# ],\n# [\n# ['\\\ #file.txt'],\n# ['#file.txt'],\n# [],\n# ],\n# [\n# ['*.php'],\n# ['app/file.php',\ \ 'file.php'],\n# ['file.phps', 'file.phps', 'filephps'],\n# ],\n# [\n# ['app/cache/'],\n\ # ['app/cache/file.txt', 'app/cache/dir1/dir2/file.txt'],\n# ['a/app/cache/file.txt'],\n\ # ],\n# [\n# ['#IamComment', '/app/cache/'],\n# ['app/cache/file.txt', 'app/cache/subdir/ile.txt'],\n\ # ['a/app/cache/file.txt', '#IamComment', 'IamComment'],\n# ],\n# [\n# ['/app/cache/',\ \ '#LastLineIsComment'],\n# ['app/cache/file.txt', 'app/cache/subdir/ile.txt'],\n\ # ['a/app/cache/file.txt', '#LastLineIsComment', 'LastLineIsComment'],\n# ],\n\ # [\n# ['/app/cache/', '\\#file.txt', '#LastLineIsComment'],\n# ['app/cache/file.txt',\ \ 'app/cache/subdir/ile.txt', '#file.txt'],\n# ['a/app/cache/file.txt', '#LastLineIsComment',\ \ 'LastLineIsComment'],\n# ],\n# [\n# ['/app/cache/', '\\#file.txt', '#IamComment',\ \ 'another_file.txt'],\n# ['app/cache/file.txt', 'app/cache/subdir/ile.txt', '#file.txt',\ \ 'another_file.txt'],\n# ['a/app/cache/file.txt', 'IamComment', '#IamComment'],\n\ # ],\n# [\n# [\n# '/app/**',\n# '!/app/bin',\n# '!/app/bin/test',\n# ],\n# ['app/test/file',\ \ 'app/bin/file'],\n# ['app/bin/test'],\n# ],\n# [\n# [\n# '/app/*/img',\n# '!/app/*/img/src',\n\ # ],\n# ['app/a/img', 'app/a/img/x', 'app/a/img/src/x'],\n# ['app/a/img/src',\ \ 'app/a/img/src/'],\n# ],\n# [\n# [\n# 'app/**/img',\n# '!/app/**/img/src',\n\ # ],\n# ['app/a/img', 'app/a/img/x', 'app/a/img/src/x', 'app/a/b/img', 'app/a/b/img/x',\ \ 'app/a/b/img/src/x', 'app/a/b/c/img'],\n# ['app/a/img/src', 'app/a/b/img/src',\ \ 'app/a/c/b/img/src'],\n# ],\n# [\n# [\n# '/*',\n# '!/foo',\n# '/foo/*',\n# '!/foo/bar',\n\ # ],\n# ['bar', 'foo/ba', 'foo/barx', 'x/foo/bar'],\n# ['foo', 'foo/bar'],\n#\ \ ],\n# [\n# [\n# '/example/**',\n# '!/example/example.txt',\n# '!/example/packages',\n\ # ],\n# ['example/test', 'example/example.txt2', 'example/packages/foo.yaml'],\n\ # ['example/example.txt', 'example/packages', 'example/packages/'],\n# ],\n# //\ \ based on https://www.atlassian.com/git/tutorials/saving-changes/gitignore\n\ # [\n# ['**/logs'],\n# ['logs/debug.log', 'logs/monday/foo.bar'],\n# [],\n# ],\n\ # [\n# ['**/logs/debug.log'],\n# ['logs/debug.log', 'build/logs/debug.log'],\n\ # ['logs/build/debug.log'],\n# ],\n# [\n# ['*.log'],\n# ['debug.log', 'foo.log',\ \ '.log', 'logs/debug.log'],\n# [],\n# ],\n# [\n# [\n# '*.log',\n# '!important.log',\n\ # ],\n# ['debug.log', 'trace.log'],\n# ['important.log', 'logs/important.log'],\n\ # ],\n# [\n# [\n# '*.log',\n# '!important/*.log',\n# 'trace.*',\n# ],\n# ['debug.log',\ \ 'important/trace.log'],\n# ['important/debug.log'],\n# ],\n# [\n# ['/debug.log'],\n\ # ['debug.log'],\n# ['logs/debug.log'],\n# ],\n# [\n# ['debug.log'],\n# ['debug.log',\ \ 'logs/debug.log'],\n# [],\n# ],\n# [\n# ['debug?.log'],\n# ['debug0.log', 'debugg.log'],\n\ # ['debug10.log'],\n# ],\n# [\n# ['debug[0-9].log'],\n# ['debug0.log', 'debug1.log'],\n\ # ['debug10.log'],\n# ],\n# [\n# ['debug[01].log'],\n# ['debug0.log', 'debug1.log'],\n\ # ['debug2.log', 'debug01.log'],\n# ],\n# [\n# ['debug[!01].log'],\n# ['debug2.log'],\n\ # ['debug0.log', 'debug1.log', 'debug01.log'],\n# ],\n# [\n# ['debug[a-z].log'],\n\ # ['debuga.log', 'debugb.log'],\n# ['debug1.log'],\n# ],\n# [\n# ['logs'],\n#\ \ ['logs', 'logs/debug.log', 'logs/latest/foo.bar', 'build/logs', 'build/logs/debug.log'],\n\ # [],\n# ],\n# [\n# ['logs/'],\n# ['logs/debug.log', 'logs/latest/foo.bar', 'build/logs/foo.bar',\ \ 'build/logs/latest/debug.log'],\n# [],\n# ],\n# [\n# [\n# 'logs/',\n# '!logs/important.log',\n\ # ],\n# ['logs/debug.log'/* must be pruned on traversal 'logs/important.log' */],\n\ # [],\n# ],\n# [\n# ['logs/**/debug.log'],\n# ['logs/debug.log', 'logs/monday/debug.log',\ \ 'logs/monday/pm/debug.log'],\n# [],\n# ],\n# [\n# ['logs/*day/debug.log'],\n\ # ['logs/monday/debug.log', 'logs/tuesday/debug.log'],\n# ['logs/latest/debug.log'],\n\ # ],\n# [\n# ['logs/debug.log'],\n# ['logs/debug.log'],\n# ['debug.log', 'build/logs/debug.log'],\n\ # ],\n# [\n# ['*/vendor/*'],\n# ['a/vendor/', 'a/vendor/b', 'a/vendor/b/c'],\n\ # ['a', 'vendor', 'vendor/', 'a/vendor', 'a/b/vendor', 'a/b/vendor/c'],\n# ],\n\ # [\n# ['**/vendor/**'],\n# ['vendor/', 'vendor/a', 'vendor/a/b', 'a/b/vendor/c/d'],\n\ # ['a', 'vendor', 'a/vendor', 'a/b/vendor'],\n# ],\n# [\n# ['***/***/vendor/*****/*****'],\n\ # ['vendor/', 'vendor/a', 'vendor/a/b', 'a/b/vendor/c/d'],\n# ['a', 'vendor',\ \ 'a/vendor', 'a/b/vendor'],\n# ],\n# [\n# ['**vendor**'],\n# ['vendor', 'vendor/',\ \ 'vendor/a', 'vendor/a/b', 'a/vendor', 'a/b/vendor', 'a/b/vendor/c/d'],\n# ['a'],\n\ # ],\n# ];\n# \n# return $cases;\n# }\n# \n# public static function providerExtended():\ \ array\n# {\n# $basicCases = self::provider();\n# \n# $cases = [];\n# foreach\ \ ($basicCases as $case) {\n# $cases[] = [\n# array_merge(['never'], $case[0],\ \ ['!never']),\n# $case[1],\n# $case[2],\n# ];\n# \n# $cases[] = [\n# array_merge(['!*'],\ \ $case[0]),\n# $case[1],\n# $case[2],\n# ];\n# \n# $cases[] = [\n# array_merge(['*',\ \ '!*'], $case[0]),\n# $case[1],\n# $case[2],\n# ];\n# \n# $cases[] = [\n# array_merge(['never',\ \ '**/never2', 'never3/**'], $case[0]),\n# $case[1],\n# $case[2],\n# ];\n# \n\ # $cases[] = [\n# array_merge(['!never', '!**/never2', '!never3/**'], $case[0]),\n\ # $case[1],\n# $case[2],\n# ];\n# \n# $lines = [];\n# for ($i = 0; $i < 30; ++$i)\ \ {\n# foreach ($case[0] as $line) {\n# $lines[] = $line;\n# }\n# }\n# $cases[]\ \ = [\n# array_merge(['!never', '!**/never2', '!never3/**'], $lines),\n# $case[1],\n\ # $case[2],\n# ];\n# }\n# \n# return $cases;\n# }\n# \n# /**\n# * @dataProvider\ \ provideNegatedPatternsCases" - name: provideNegatedPatternsCases visibility: public parameters: [] comment: null traits: - PHPUnit\Framework\TestCase - Symfony\Component\Finder\Gitignore interfaces: []