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')
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')