PHPackages                             dholmes/bga-workbench - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dholmes/bga-workbench

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dholmes/bga-workbench
=====================

BoardGameArena Workbench

0.2.1(4y ago)375.3k↓100%10[14 issues](https://github.com/danielholmes/bga-workbench/issues)[1 PRs](https://github.com/danielholmes/bga-workbench/pulls)MITPHPPHP &gt;=7.2.0

Since Sep 21Pushed 4y ago4 watchersCompare

[ Source](https://github.com/danielholmes/bga-workbench)[ Packagist](https://packagist.org/packages/dholmes/bga-workbench)[ RSS](/packages/dholmes-bga-workbench/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (17)Versions (25)Used By (0)

BoardGameArena Workbench
========================

[](#boardgamearena-workbench)

[![Build](https://github.com/danielholmes/bga-workbench/actions/workflows/build.yml/badge.svg)](https://github.com/danielholmes/bga-workbench/actions/workflows/build.yml)[![Latest Stable Version](https://camo.githubusercontent.com/7580e9a2d11dc6957c505eab8217be06adc3757f92235bd5d6a48e2b5d66f218/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64686f6c6d65732f6267612d776f726b62656e63682e737667)](https://packagist.org/packages/dholmes/bga-workbench)

A set of tools to work with [BoardGameArena](https://boardgamearena.com/) projects.

- [Installation](#installation)
- [Initialise BGA Project](#initialise-bga-project)
- [Deploying to BGA Studio](#deploying-to-bga-studio)
- [Compiling composer projects](#compiling-composer-projects)
- [Testing utilities](#testing-utilities)
- [Projects Using BGA Workbench](#projects-using-bga-workbench)
- [Development](#development)

    - [Requirements](#requirements)
    - [Setting up Developer Machine](#setting-up-developer-machine)
    - [Running tests](#running-tests)

Installation
------------

[](#installation)

Via composer:

```
composer require --dev dholmes/bga-workbench
```

Via Docker:

```
docker build -t bgawb .
alias bgawb="docker run --rm -v $PWD:/data -w /data bgawb"
```

(this last line should be set in your ~/.bashrc to keep the alias working in a new terminal)

To set up your project to work with BGA Workbench you need to have a `bgaproject.yml` file in the root. To generate one see the [`bgawb init` command](#initialise-bga-project).

Initialise BGA Project
----------------------

[](#initialise-bga-project)

Once you've installed bgawb you can run the below command to interactively create a `bgaproject.yml` file in your current directory.

```
bgawb init
```

Deploying to BGA Studio
-----------------------

[](#deploying-to-bga-studio)

```
bgawb build --deploy
```

### Continuous Deployment to Studio

[](#continuous-deployment-to-studio)

Watches development files and deploys them as they change.

```
bgawb build --deploy --watch
```

Compiling composer projects
---------------------------

[](#compiling-composer-projects)

The Board Game Arena production framework/environment doesn't natively support a [Composer](https://getcomposer.org/)project setup. By having `useComposer: true` set in your `bgaproject.yml` file, the \[`bgawb build`\](Deploying to BGA Studio) command will merge all non-dev composer dependencies inline into your .game.php file before deploying.

Testing Utilities
-----------------

[](#testing-utilities)

Some testing utilities are provided to help test various parts of a standard BGA project game.

### The Validate Command

[](#the-validate-command)

Will run some basic checks on your project setup. e.g. whether you have the required files to function on the BGA platform (`.game.php`, `.action.php`, etc), whether your `states.inc.php` file is valid, etc.

```
bgawb validate
```

### PHPUnit TestHelp trait

[](#phpunit-testhelp-trait)

Including this trait and implementing the `createGameTableInstanceBuilder` method will set up and tear down a game table instance for each test that is run. Note that this makes use of the `setUp` and `tearDown` PHPUnit hooks

```
