PHPackages                             lmuzinic/advent-of-code-bootstrap - 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. lmuzinic/advent-of-code-bootstrap

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

lmuzinic/advent-of-code-bootstrap
=================================

118PHP

Since Nov 29Pushed 8y ago1 watchersCompare

[ Source](https://github.com/lmuzinic/advent-of-code-bootstrap)[ Packagist](https://packagist.org/packages/lmuzinic/advent-of-code-bootstrap)[ RSS](/packages/lmuzinic-advent-of-code-bootstrap/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Bootstrap/test printer for Advent of Code
=========================================

[](#bootstraptest-printer-for-advent-of-code)

> [Advent of Code](https://adventofcode.com/) is a series of small programming puzzles for a variety of skill levels. They are self-contained and are just as appropriate for an expert who wants to stay sharp as they are for a beginner who is just learning to code. Each puzzle calls upon different skills and has two parts that build on a theme.

Whether you want to participate, brush up on your PHP skills, try out TDD approach or just have fun, this bootstrap could help you out.

Contents
--------

[](#contents)

### Interface

[](#interface)

The `AdventOfCode\Bootstrap\Day` interface consists of two methods that take puzzle string input. Idea is to implement each day in separate file and each puzzle in separate method.

### TestPrinter

[](#testprinter)

The `AdventOfCodePrinter` is a custom test printer for PHPUnit. It suppresses all output during runtime, but records it, along with test case name and outputs it later when all tests pass.

That way you can use PHPUnit to run actual puzzle input without assertions and display it so it can be submitted to Advent of Code.

Add annotation `@doesNotPerformAssertions` to those tests and just echo the result.

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

[](#installation)

The recommended way to install is [through composer](http://getcomposer.org).

```
{
    "require-dev": {
        "lmuzinic/advent-of-code-bootstrap": "@dev"
    }
}
```

Once installed, create a phpunit.xml and add `printerClass="AdventOfCode\Bootstrap\AdventOfCodePrinter"` to use AdventOfCodePrinter instead of default one.

```

        ./tests

            ./src

```

Code/Test examples
------------------

[](#codetest-examples)

### [Code example of 2015/Day 1](https://adventofcode.com/2015/day/1)

[](#code-example-of-2015day-1)

```
