-
macOS, Linux or Windows
-
git client
-
curl command line utility
-
PHP version
The kata is configured to run with PHP version 8.3 or above.
To use a different version, simply update the value for
php
in composer.json. -
Composer dependency manager
git clone https://github.com/murex/Kata-BowlingGame.git
cd Kata-BowlingGame/php
composer update
You can run the kata from the command line or from your IDE of choice.
You may also run it using TCR if you want to add a bit of spice.
- From a terminal
- From a terminal with TCR
- From PhpStorm
- From PhpStorm with TCR
- From IntelliJ
- From IntelliJ with TCR
- From Visual Studio Code
- From Visual Studio Code with TCR
Reminder: the commands below should be run from Kata-BowlingGame/php directory
To check the code syntax:
./vendor/bin/parallel-lint --exclude vendor .
To run the tests:
./vendor/bin/phpunit tests
Note to Windows users
Use a git bash terminal for running the command below. Windows CMD and PowerShell are not supported
Reminder: the commands below should be run from Kata-BowlingGame/php directory
Type the following to start TCR:
./tcrw
Refer to Using TCR section for additional details about TCR and available options.
Open PhpStorm and select:
File
> Open
> Kata-BowlingGame
> php
Run all the tests in the project.
The "Run" tool window should display all the executed tests.
TCR is provided as a command line utility running in a terminal. You can run it from PhpStorm directly, through leveraging on its built-in terminal.
Open PhpStorm and select:
File
> Open
> Kata-BowlingGame
> php
TCR is constantly watching the filesystem for changes. For this reason you need to turn off PhpStorm's auto-save in order for it to behave as expected.
File
> Settings
> Appearance & Behavior
> System Settings
Under Autosave
section, uncheck the 2 following options:
- Save files if the IDE is idle for ___ seconds
- Save files when switching to a different application or a built-in terminal
Windows Only
Skip this step if you're on macOS or Linux
PhpStorm for Windows is usually set up to run PowerShell by default in its built-in terminal. TCR does not run in PowerShell.
File
> Settings
> Tools
> Terminal
Under Application Settings
section, set the Shell path
to C:\Program Files\Git\bin\bash.exe
The above path is for a default git installation location. You may need to adjust it in case you have installed git at a different location.
View
> Tool Windows
> Terminal
Reminder: the command below should be run from Kata-BowlingGame/php directory
From the built-in terminal:
./tcrw
Refer to Using TCR section for additional details about TCR and available options.
Important: This requires to have
IntelliJ IDEA Ultimate
edition.IntelliJ's PHP plugin is not available with the Community edition. You can still use it as an editor for PHP files, but you will not be able to use the benefits brought by the PHP plugin, such as syntax highlighting, code refactoring or integration with IntelliJ's test navigator.
- Open IntelliJ and select:
File
>Settings
>Plugins
>Marketplace
- Search for
PHP
and clickInstall
- Restart
IntelliJ
to activate the plugin
File
>Settings
>Languages & Frameworks
>PHP
>CLI Interpreter
- Enter the path to the PHP interpreter on your machine
- Click
OK
File
> Open
> Kata-BowlingGame
> php
From the Project
navigator window, right click on tests
directory and select
Run 'tests'
.
The "Run" tool window should display all the executed tests.
Important: This requires to have
IntelliJ IDEA Ultimate
edition.Refer to the section Running the kata from IntelliJ for instructions related to installation of IntelliJ's PHP plugin.
TCR is provided as a command line utility running in a terminal. You can run it from IntelliJ directly, through leveraging on its built-in terminal.
Open IntelliJ and select:
File
> Open
> Kata-BowlingGame
> php
TCR is constantly watching the filesystem for changes. For this reason you need to turn off IntelliJ's auto-save in order for it to behave as expected.
File
> Settings
> Appearance & Behavior
> System Settings
Under Autosave
section, uncheck the 2 following options:
- Save files if the IDE is idle for ___ seconds
- Save files when switching to a different application or a built-in terminal
Windows Only
Skip this step if you're on macOS or Linux
IntelliJ for Windows is usually set up to run PowerShell by default in its built-in terminal. TCR does not run in PowerShell.
File
> Settings
> Tools
> Terminal
Under Application Settings
section, set the Shell path
to C:\Program Files\Git\bin\bash.exe
The above path is for a default git installation location. You may need to adjust it in case you have installed git at a different location.
View
> Tool Windows
> Terminal
Reminder: the command below should be run from Kata-BowlingGame/php directory
From the built-in terminal:
./tcrw
Refer to Using TCR section for additional details about TCR and available options.
- Menu
View
>Extensions
- Search for
php
- Select PHP and click
Install
Choose Open Folder
, navigate to Kata-BowlingGame
/ php
then click Select Folder
.
From the Test Explorer
window (menu View
> Testing
):
- Click on the
Play
button to run the tests.
TCR is provided as a command line utility running in a terminal. You can run it from Visual Studio Code directly, through leveraging on its built-in terminal.
- Menu
View
>Extensions
- Search for
php
- Select PHP and click
Install
Open Visual Studio Code, choose Open Folder
, navigate to Kata-BowlingGame
/ php
then click Select Folder
.
TCR is constantly watching the filesystem for changes. For this reason you need to make sure that Visual Studio Code's auto-save is turned off in order for TCR to behave as expected.
File
> Preferences
> Settings
In Text Editor
> Files
section, make sure that Auto Save
setting is set to off
Windows Only
Skip this step if you're on macOS or Linux
Visual Studio Code for Windows is usually set up to run PowerShell by default in its built-in terminal. TCR does not run in PowerShell.
File
> Preferences
> Settings
In Features
> Terminal
section, set External: Windows Exec
to C:\Program Files\Git\bin\bash.exe
The above path is for a default git installation location. You may need to adjust it in case you have installed git at a different location.
Terminal
> New Terminal
Reminder: the command below should be run from Kata-BowlingGame/php directory
From the built-in terminal:
./tcrw
Refer to Using TCR section for additional details about TCR and available options.
Here are the main shortcuts available once TCR utility is running:
Shortcut | Description |
---|---|
o / O |
Open in browser (with web subcommand only) |
d / D |
Enter driver role |
n / N |
Enter navigator role |
t / T |
Query timer status |
p / P |
Toggle on/off git auto-push |
l / L |
Pull from remote |
s / S |
Push to remote |
a / A |
Abort current command (when in driver role) |
q / Q |
Quit current role / Quit TCR |
? |
List available options |
Refer to TCR - Test && Commit || Revert page for additional details and explanations about TCR utility.