diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..609aebc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: CI + +on: [pull_request] + +jobs: + run-tests: + strategy: + fail-fast: false + matrix: + st-version: [4] + # st-version: [3, 4] + # os: ["ubuntu-latest", "macOS-latest", "windows-latest"] + os: ["ubuntu-latest"] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: SublimeText/UnitTesting/actions/setup@v1 + with: + # Details: https://github.com/SublimeText/UnitTesting/blob/master/actions/setup/action.yaml#L19 + package-name: Phpcs + sublime-text-version: ${{ matrix.st-version }} + - uses: SublimeText/UnitTesting/actions/run-tests@v1 \ No newline at end of file diff --git a/tests/test_phpcs.py b/tests/test_phpcs.py new file mode 100644 index 0000000..9c80703 --- /dev/null +++ b/tests/test_phpcs.py @@ -0,0 +1,18 @@ +import os +import re +import sys +import sublime +from unittest import TestCase + + +from Phpcs.phpcs import Sniffer + + +class TestDiffViewInternalFunctions(TestCase): + def test_something(self): + php_path = "/bin/php" + s = sublime.load_settings("phpcs.sublime-settings") + s.set("phpcs_php_prefix_path", php_path) + + args = Sniffer().get_executable_args() + self.assertIn(php_path, args)