Skip to content

Commit

Permalink
deprecate basic strategy; rename to sublime
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardroche committed Aug 16, 2023
1 parent 16768d8 commit 89c194c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## 3.18.1 - Unreleased

### Deprecated

* The deprecated strategy `basic` should be replaced with `sublime`.

## 3.18.0 - 2023-08-06

### Added
Expand Down
11 changes: 9 additions & 2 deletions Preferences.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,15 @@
// Save all dirty buffers before running tests.
"phpunit.save_all_on_run": true,

// Execution environment to run tests. Valid values: basic|iterm|kitty
"phpunit.strategy": "basic",
// Choose the desired execution environment for running tests.
// Options include:
// - sublime
// - iterm
// - kitty
// - xterm
// - cmd
// - powershell
"phpunit.strategy": "sublime",

// Enable SSH.
"phpunit.ssh": false,
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Command Palette → Preferences: PHPUnit Settings

| Strategy | Identifier | Description
| :------: | :--------: | :----------
| **Basic** (default) | `basic` | Sends test commands to Sublime Text exec output panel.
| **Sublime** (default) | `sublime` | Sends test commands to Sublime Text exec output panel.
| **iTerm2.app** | `iterm` | Sends test commands to `iTerm2 >= 2.9` (useful in MacVim GUI).
| **[Kitty]** | `kitty` | Sends test commands to Kitty terminal.
| **[xterm]** | `xterm` | Sends test commands to xterm terminal. :new:
Expand All @@ -180,7 +180,7 @@ Command Palette → Preferences: PHPUnit Settings
| `phpunit.on_post_save` | `list` | `[]` | Auto commands when views are saved. <br>Example: `["phpunit_test_file"]`
| `phpunit.debug` | `boolean` | `false` | Prints test runner debug information.
| `phpunit.prepend_cmd` | `list` | `[]` | Prepends test runner command.
| `phpunit.strategy` | `string` | `basic` | Execution environment to run tests.
| `phpunit.strategy` | `string` | `sublime` | Execution environment to run tests.
| `phpunit.font_size` | `integer` | Editor default. | Font size of PHPUnit output.
| `phpunit.composer` | `boolean` | `true` | Use Composer installed executables.
| `phpunit.artisan` | `boolean` | `false` | Use Artisan to run tests.
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ def get_phpunit_options(view, options=None) -> dict:
# See https://github.com/gerardroche/sublime-phpunit/issues/103
# See https://github.com/gerardroche/sublime-phpunit/issues/102
# See https://github.com/laravel/framework/issues/46759
if get_setting(view, 'strategy') == 'basic':
if get_setting(view, 'strategy') in ('sublime', 'basic'):
if get_setting(view, 'pest') or get_setting(view, 'artisan'):
options['colors=never'] = True

Expand Down
4 changes: 2 additions & 2 deletions tests/lib/utils/test_get_phpunit_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ def testget_phpunit_options_has_session(self):
self.assertEquals({'no-coverage': True, 'no-progress': False}, get_phpunit_options(self.view))

def test_artisan_should_never_enable_colors(self):
self.view.settings().set('phpunit.strategy', 'basic')
self.view.settings().set('phpunit.strategy', 'sublime')
self.view.settings().set('phpunit.artisan', True)
self.assertEquals({'colors=never': True}, get_phpunit_options(self.view))
self.view.settings().set('phpunit.strategy', 'basic')
self.view.settings().set('phpunit.strategy', 'sublime')

def test_pest_and_artisan_only_disable_colors_for_the_basic_strategy(self):
self.view.settings().set('phpunit.strategy', 'iterm')
Expand Down

0 comments on commit 89c194c

Please sign in to comment.