コード例 #1
0
    def test_execute_fixer(self):
        tool = Phpcs(self.problems, {'fixer': True})

        original = read_file(self.fixtures[1])
        tool.execute_fixer(self.fixtures)

        updated = read_and_restore_file(self.fixtures[1], original)
        assert original != updated, 'File content should change.'
        eq_(0, len(self.problems.all()), 'No errors should be recorded')
コード例 #2
0
ファイル: test_phpcs.py プロジェクト: esoergel/lint-review
    def test_execute_fixer(self):
        tool = Phpcs(self.problems, {'fixer': True})

        original = read_file(self.fixtures[1])
        tool.execute_fixer(self.fixtures)

        updated = read_and_restore_file(self.fixtures[1], original)
        assert original != updated, 'File content should change.'
        eq_(0, len(self.problems.all()), 'No errors should be recorded')
コード例 #3
0
    def test_execute_fixer__no_problems_remain(self):
        tool = Phpcs(self.problems, {'fixer': True})

        # The fixture file can have all problems fixed by phpcs
        original = read_file(self.fixtures[1])
        tool.execute_fixer(self.fixtures)
        tool.process_files(self.fixtures)

        read_and_restore_file(self.fixtures[1], original)
        eq_(0, len(self.problems.all()), 'All errors should be autofixed')
コード例 #4
0
ファイル: test_phpcs.py プロジェクト: esoergel/lint-review
    def test_execute_fixer__no_problems_remain(self):
        tool = Phpcs(self.problems, {'fixer': True})

        # The fixture file can have all problems fixed by phpcs
        original = read_file(self.fixtures[1])
        tool.execute_fixer(self.fixtures)
        tool.process_files(self.fixtures)

        read_and_restore_file(self.fixtures[1], original)
        eq_(0, len(self.problems.all()), 'All errors should be autofixed')