示例#1
0
 def test_execute(self, call):
     call.return_value = 0
     task = format_tasks.PhpFormatTask()
     task.execute('/path/to/gapic')
     expected_cmds = (
         'php-cs-fixer fix /path/to/gapic',
         'php-cs-fixer fix /path/to/gapic --fixers=phpdoc_var_to_type',
         'phpcbf --standard=PSR2 --no-patch /path/to/gapic',
     )
     assert call.call_count == len(expected_cmds)
     for c, expected in zip(call.mock_calls, expected_cmds):
         _, args, _ = c
         assert ' '.join(args[0]) == expected
示例#2
0
 def test_execute(self, call):
     call.return_value = 0
     task = format_tasks.PhpFormatTask()
     task.execute('/path/to/gapic')
     expected_cmds = (
         'php-cs-fixer fix --rules=@Symfony,-phpdoc_annotation_without_dot '
         '/path/to/gapic',
         'php-cs-fixer fix --rules={"phpdoc_no_alias_tag" : {'
         '"replacements" : {"var" : "type"}}} /path/to/gapic',
         'phpcbf --standard=PSR2 --no-patch /path/to/gapic',
     )
     assert call.call_count == len(expected_cmds)
     for c, expected in zip(call.mock_calls, expected_cmds):
         _, args, _ = c
         assert ' '.join(args[0]) == expected
示例#3
0
 def test_validate(self):
     task = format_tasks.PhpFormatTask()
     assert task.validate() == [php_requirements.PhpFormatRequirements]