Skip to content

Commit

Permalink
Refactor: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardroche committed Aug 4, 2023
1 parent 6f6d981 commit d42051a
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 9 deletions.
1 change: 1 addition & 0 deletions tests/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@


class PhpunitTestSetupFixtureCommand(TextCommand):

def run(self, edit, text):

# This fixes an issue where an exception is thrown when reloading the
Expand Down
Empty file added tests/lib/__init__.py
Empty file.
Empty file added tests/lib/strategy/__init__.py
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@

import sublime

from PHPUnitKit.lib.strategy import _create_exec_output_panel
from PHPUnitKit.tests import unittest

from PHPUnitKit.lib.strategy import _create_exec_output_panel


class TestCreateExecOutputPanel(unittest.ViewTestCase):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
# along with PHPUnitKit. If not, see <https://www.gnu.org/licenses/>.

import re
from PHPUnitKit.tests import unittest

from sublime import platform

from PHPUnitKit.tests import unittest

from PHPUnitKit.lib.strategy import _exec_file_regex


Expand Down
Empty file added tests/lib/utils/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from sublime import find_resources

from PHPUnitKit.tests import unittest

from PHPUnitKit.lib.utils import find_nearest_tests


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# along with PHPUnitKit. If not, see <https://www.gnu.org/licenses/>.

from PHPUnitKit.tests import unittest

from PHPUnitKit.lib.utils import find_nearest_tests


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# along with PHPUnitKit. If not, see <https://www.gnu.org/licenses/>.

from PHPUnitKit.tests import unittest

from PHPUnitKit.lib.utils import find_php_classes


Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions tests/test_finder.py → tests/lib/utils/test_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# along with PHPUnitKit. If not, see <https://www.gnu.org/licenses/>.

import os

from PHPUnitKit.tests import unittest

from PHPUnitKit.lib.utils import find_phpunit_configuration_file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@

import sublime

from PHPUnitKit.lib.utils import get_php_executable
from PHPUnitKit.tests import unittest

from PHPUnitKit.lib.utils import get_php_executable


class TestGetPHPExecutable(unittest.ViewTestCase):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@

import sublime

from PHPUnitKit.lib.utils import get_phpunit_executable
from PHPUnitKit.tests import unittest

from PHPUnitKit.lib.utils import get_phpunit_executable


class TestGetPHPUnitExecutable(unittest.ViewTestCase):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
# You should have received a copy of the GNU General Public License
# along with PHPUnitKit. If not, see <https://www.gnu.org/licenses/>.

from PHPUnitKit.lib.utils import get_phpunit_options
from PHPUnitKit.tests import unittest

from PHPUnitKit.lib.utils import get_phpunit_options


@unittest.mock.patch.dict('PHPUnitKit.lib.utils._session', {}, clear=True)
class TestGetPHPUnitOptions(unittest.ViewTestCase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# along with PHPUnitKit. If not, see <https://www.gnu.org/licenses/>.

from PHPUnitKit.tests import unittest

from PHPUnitKit.lib.utils import has_test


Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion tests/test_phpunit.py → tests/lib/utils/test_phpunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
# You should have received a copy of the GNU General Public License
# along with PHPUnitKit. If not, see <https://www.gnu.org/licenses/>.

from PHPUnitKit.tests import unittest

from PHPUnitKit.lib.utils import set_last_run
from PHPUnitKit.lib.utils import get_phpunit_options
from PHPUnitKit.tests import unittest


@unittest.mock.patch.dict('PHPUnitKit.lib.utils._session', {'options': {}}, clear=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
# You should have received a copy of the GNU General Public License
# along with PHPUnitKit. If not, see <https://www.gnu.org/licenses/>.

from PHPUnitKit.lib.utils import resolve_working_dir
from PHPUnitKit.tests import unittest

from PHPUnitKit.lib.utils import resolve_working_dir


class ViewStub():
def __init__(self, file_name: str, folders: list):
Expand Down
5 changes: 3 additions & 2 deletions tests/unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
# You should have received a copy of the GNU General Public License
# along with PHPUnitKit. If not, see <https://www.gnu.org/licenses/>.

import os
import sys

from unittest import TestCase
from unittest import mock # noqa: F401
from unittest import skipIf # noqa: F401
import os
import sys

from sublime import find_resources
from sublime import active_window
Expand Down

0 comments on commit d42051a

Please sign in to comment.