Hoa is a modular, extensible and
structured set of PHP libraries.
Moreover, Hoa aims at being a bridge between industrial and research worlds.
This tools is an extension for atoum to help you creating your unit test for a project using hoa/Option
With Composer, to include this library into
your dependencies, you need to
require hoa/atoum-option-extension
:
$ composer require hoa/atoum-option-extension
For more installation procedures, please read the Source page.
Before running the test suites, the development dependencies must be installed:
$ composer install
Then, to run all the test suites:
$ vendor/bin/atoum
For more information, please read the contributor guide.
<?php
$this->given($this->newTestedInstance)
->option($this->testedInstance->doSomethingReturningAnOption())
->isNone;
$this->given($this->newTestedInstance)
->option($this->testedInstance->doSomethingReturningAnOption())
->isSome('This should be a value');
$this->given($this->newTestedInstance)
->option($this->testedInstance->wrapTheGivenValueInAnOption(42))
->some()
->integer($this->getValue())->isEqualTo(42);
- option: validated that the given value is an Option instance
- isSome('custom failed message') or isSome: validated that the Option contains a value
- isNone('custom failed message') or isNone: validated that the Option doesn't contains a value
- some() or some: allow you to get the unwrapped value to chain on, validated that the value is in the option first
There are mainly two ways to get help:
- On the
#hoaproject
IRC channel, - On the forum at users.hoa-project.net.
Do you want to contribute? Thanks! A detailed contributor guide explains everything you need to know.
Hoa is under the New BSD License (BSD-3-Clause). Please, see
LICENSE
for details.